summaryrefslogtreecommitdiffstats
path: root/deployment/playbooks/cleanup-crs.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'deployment/playbooks/cleanup-crs.yaml')
-rw-r--r--deployment/playbooks/cleanup-crs.yaml38
1 files changed, 38 insertions, 0 deletions
diff --git a/deployment/playbooks/cleanup-crs.yaml b/deployment/playbooks/cleanup-crs.yaml
new file mode 100644
index 00000000..3d6ee533
--- /dev/null
+++ b/deployment/playbooks/cleanup-crs.yaml
@@ -0,0 +1,38 @@
+---
+- hosts: localhost
+ user: root
+ become: false
+ ignore_errors: yes
+ vars_files:
+ - vars/main.yaml
+ roles:
+ - instance-groups
+
+- hosts: crs
+ user: root
+ become: false
+ ignore_errors: yes
+ vars_files:
+ - vars/main.yaml
+ roles:
+ - rhsm-unregister
+
+- hosts: localhost
+ user: root
+ become: false
+ ignore_errors: yes
+ vars_files:
+ - vars/main.yaml
+ tasks:
+ - name: Delete crs VMs
+ vmware_guest:
+ hostname: "{{ vcenter_host }}"
+ username: "{{ vcenter_username }}"
+ password: "{{ vcenter_password }}"
+ datacenter: "{{ vcenter_datacenter }}"
+ folder: "/{{ vcenter_folder }}"
+ name: "{{ item.value.guestname }}"
+ state: absent
+ force: true
+ with_dict: "{{host_inventory}}"
+ when: "'crs' in item.value.guestname"