Gareth Healy
2020-02-10 16f23bf871020f763ae1be4ab1ecd92da8131516
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
---
# Implement your Workload removal tasks here
- name: Fail if _namespace defined
  fail:
    msg: _namespace var is defined. didnt expect that
  when: _namespace is defined
 
- name: Fail if user count incorrect
  fail:
    msg: User count end({{ user_count_end }}) <= user count start ({{ user_count_start }})
  when: user_count_end|int <= user_count_start|int
 
- name: Delete project for cluster operators
  command: >
    oc delete project {{ item }}
  with_items:
    - "amq-streams"
    - "codeready-workspaces"
  ignore_errors: yes
 
- name: Delete projects loop
  include_tasks: remove_workload_per_project.yml
  loop: "{{ range(user_count_start|int, user_count_end|int)|list }}"
  loop_control:
    loop_var: user_num
 
# Leave this as the last task in the playbook.
- name: remove_workload tasks complete
  debug:
    msg: "Remove Workload tasks completed successfully."
  when: not silent|bool