-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexercise8-break.yaml
More file actions
51 lines (46 loc) · 1.46 KB
/
exercise8-break.yaml
File metadata and controls
51 lines (46 loc) · 1.46 KB
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
46
47
48
49
50
51
---
- name: Preparing the exercise8
hosts: localhost
gather_facts: true
vars:
user: "{{ lookup('env', 'USER') }}"
tasks:
- name: Create SSH config file with StrictHostKeyChecking no
ansible.builtin.copy:
dest: '/home/{{ user }}/.ssh/config'
content: |
Host *
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
owner: '{{ user }}'
group: '{{ user }}'
mode: '0600'
- name: Create the idrsa secret
kubernetes.core.k8s:
state: present
template: "exercise8-secret.yaml.j2"
register: secretidrsa
until: secretidrsa is succeeded
retries: 60
delay: 10
failed_when: secretidrsa is failed or secretidrsa.failed
- name: Creating the exercise8 virtual machine
kubernetes.core.k8s:
state: present
template: "exercise8-vm-rhel9.yaml.j2"
register: breakvm
until: breakvm is succeeded
retries: 60
delay: 10
failed_when: breakvm is failed or breakvm.failed
- name: Wait for VM to be running
kubernetes.core.k8s_info:
api_version: kubevirt.io/v1
kind: VirtualMachineInstance
namespace: "namespace-{{ user }}"
name: "exercise8"
register: exercise8info
until: "exercise8info.resources | length > 0 and exercise8info.resources[0].status.phase == 'Running'"
retries: 60
delay: 10
failed_when: exercise8info.resources | length == 0