James Falkner
2020-02-26 06c3cad47f579eb805fc06b540e01c6abd380c32
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
32
33
34
35
36
# vim: set ft=ansible
---
# Implement your Workload removal tasks here
- name: create usernames
  set_fact:
    users: "{{ users | default([]) + ['user'+item | string] }}"
  loop: "{{ range(1,((num_users | int) + 1)) | list }}"
 
- name: remove the user Projects
  k8s:
    state: absent
    name: "{{ item }}-project"
    kind: Project
    api_version: project.openshift.io/v1
  with_list: "{{ users }}"
 
- name: remove the guides
  k8s:
    state: absent
    name: "guides"
    kind: Project
    api_version: project.openshift.io/v1
 
# TODO delete CodeReady
- name: remove the CodeReady
  k8s:
    state: absent
    name: "codeready"
    kind: Project
    api_version: project.openshift.io/v1
 
# 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