Nate Stephany
2020-03-10 e5c58270876bf324b5065f1236f9e6b2602a91a5
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
37
38
---
# Implement your Workload removal tasks here
 
- name: Remove NFS Storage Project
  k8s:
    name: "{{ _nfs_project }}"
    api_version: v1
    kind: Namespace
    state: absent
 
- name: Clean up PVs
  k8s:
    api_version: v1
    kind: PersistentVolume
    name: "{{ item }}"
    state: absent
  loop:
    - "vol0"
    - "vol1"
    - "vol2"
    - "vol3"
    - "vol4"
    - "vol5"
    - "vol6"
    - "vol7"
 
- name: Remove storage class
  k8s:
    api_version: storage.k8s.io/v1
    kind: StorageClass
    name: "{{ _nfs_provided_storage_class }}"
    state: absent
 
# 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