-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexercise8-clean.yaml
More file actions
37 lines (33 loc) · 991 Bytes
/
exercise8-clean.yaml
File metadata and controls
37 lines (33 loc) · 991 Bytes
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
- name: Cleaning the exercise8
hosts: localhost
gather_facts: true
vars:
user: "{{ lookup('env', 'USER') }}"
tasks:
- name: Clean the exercise8 vm
kubernetes.core.k8s:
state: absent
template: "exercise8-vm-rhel9.yaml.j2"
register: cleanvm
until: cleanvm is succeeded
retries: 60
delay: 10
failed_when: cleanvm is failed or cleanvm.failed
- name: Wait for the Virtual Machine to be removed
kubernetes.core.k8s_info:
kind: VirtualMachine
namespace: "namespace-{{ user }}"
name: "exercise8"
register: cleanvm
retries: 60
delay: 2
until: cleanvm.resources | length == 0
- name: Removing the idrsa secret
kubernetes.core.k8s:
state: absent
template: "exercise8-secret.yaml.j2"
register: secretidrsa
until: secretidrsa is succeeded
retries: 60
delay: 10
failed_when: secretidrsa is failed or secretidrsa.failed