-
Notifications
You must be signed in to change notification settings - Fork 39
/
99_cleanup_sno.yml
38 lines (35 loc) · 1.19 KB
/
99_cleanup_sno.yml
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
---
- name: Cleanup playbook
hosts: vm_host
vars_files:
- vars/sno_vars.yml
tasks:
- name: Set home directory as fact
ansible.builtin.set_fact:
home_dir: "{{ ansible_env.HOME }}"
- name: Destroy cluster VM
community.general.terraform:
force_init: true
project_path: "{{ workspace_directory.base_path }}/{{ cluster.name }}/terraform/{{ item }}"
state: absent
loop:
- sno
become: true
- name: Use TF project to ensure pool and network are removed
community.general.terraform:
project_path: "{{ workspace_directory.base_path }}/{{ cluster.name }}/terraform/libvirt-resources-sno"
force_init: true
state: absent
become: true
- name: Delete all created paths
ansible.builtin.file:
path: "{{ item }}"
state: absent
loop:
- /usr/bin/terraform
- /usr/bin/openshift-baremetal-install
- /usr/bin/coreos-installer
- "{{ workspace_directory.base_path }}/{{ cluster.name }}"
- /etc/NetworkManager/conf.d/{{ cluster.name }}-localdns.conf
- /etc/NetworkManager/dnsmasq.d/{{ cluster.name }}-libvirt_dnsmasq.conf
become: true