-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdelete-rosa.yml
42 lines (30 loc) · 1.04 KB
/
delete-rosa.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
39
40
41
42
---
- hosts: localhost
connection: local
vars:
cluster: "{{(lookup('env','CLUSTER'))}}"
rosa_token: "{{(lookup('env','ROSA_TOKEN'))}}"
tasks:
- import_tasks: configure-aws.yml
- name: login ROSA
shell: rosa login --token {{ rosa_token }}
- name: Run Backup
shell: /opt/redhat/automacao/backup.sh
- name: get rosa cluster id
shell: >
rosa list cluster|
/bin/awk 'NR==2{print $1}'
register: id_cluster
# - name: debug
# debug:
# msg: '{{ id_cluster.stdout }}'
- name: Delete cluster ROSA
shell: rosa delete cluster -c {{ cluster }} -y
register: delete_cluster_rosa
- name: Pause for 10 minutes to destroy Cluster
pause:
minutes: 10
- name: Delete Operator account
shell: rosa delete operator-roles -c {{ id_cluster.stdout }} -m auto -y
- name: Delete oidc-provider
shell: rosa delete oidc-provider -c {{ id_cluster.stdout }} -m auto -y