-
Notifications
You must be signed in to change notification settings - Fork 2
/
opentlc_delete.yaml
executable file
·45 lines (42 loc) · 1.28 KB
/
opentlc_delete.yaml
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
39
40
41
42
43
44
45
#!/usr/bin/env ansible-playbook
---
- name: "OPENTLC: Deleting all Environments"
hosts: localhost
connection: local
gather_facts: True
vars_files:
- configuration.yaml
- credentials.yaml
vars:
cloudforms_api_url: "{{ opentlc_api_url }}"
pre_tasks:
- name: "Parameter: username"
fail: msg="username is not defined or is empty"
when: username is not defined or username is none
tags: [ always ]
- name: "Parameter: password"
fail: msg="password is not defined or is empty"
when: password is not defined or password is none
tags: [ always ]
roles:
- role: cloudforms_login
- role: cloudforms_check_existing_service
- role: cloudforms_fetch_custom_attributes_opentlc
- role: bastion_init
- name: Uninstall an existing OpenShift environment
hosts: openshift_bastion
gather_facts: False
become: True
vars:
guid: "{{ hostvars['localhost']['guid'] }}"
tasks:
- name: "Uninstalling OpenShift"
command: openshift-install destroy cluster --dir /root/cluster-{{ guid }} --log-level=debug
ignore_errors: True
tags: [ openshift_install ]
- name: Deprovisioning
hosts: localhost
connection: local
gather_facts: False
roles:
- role: cloudforms_deprovision