Debian Codegraph @

ansible_collections/containers/podman/tests/integration/targets/podman_play/tasks/root-play.yml

raw
1 - name: Test podman rootful pod play
2 block:
3
4 - name: Discover cgroups version
5 shell: podman info | grep cgroupVersion | awk {'print $2'}
6 register: cgroups
7
8 - name: Set cgroups version
9 set_fact:
10 cgroups_version: "{{ cgroups.stdout }}"
11
12 - name: Delete all pods leftovers from tests
13 containers.podman.podman_pod:
14 executable: "{{ test_executable | default('podman') }}"
15 name: "{{ item }}"
16 state: absent
17 loop:
18 - web-deploy-root
19 - web-deploy-root-pod
20 - web-deploy-root-pod-0
21
22 - name: Play kube file
23 containers.podman.podman_play:
24 executable: "{{ test_executable | default('podman') }}"
25 kube_file: /tmp/play-root1.yaml
26 state: started
27 register: play1
28
29 - name: Play same kube file again
30 containers.podman.podman_play:
31 executable: "{{ test_executable | default('podman') }}"
32 kube_file: /tmp/play-root1.yaml
33 state: started
34 register: play2
35
36 - name: Check info
37 assert:
38 that:
39 - play1 is changed
40 - play2 is not changed
41
42 - name: Recreate play
43 containers.podman.podman_play:
44 executable: "{{ test_executable | default('podman') }}"
45 kube_file: /tmp/play-root1.yaml
46 state: started
47 recreate: true
48 register: play3
49
50 - name: Check info
51 assert:
52 that:
53 - play3 is changed
54
55 - name: Check 'created' after 'started'
56 containers.podman.podman_play:
57 executable: "{{ test_executable | default('podman') }}"
58 kube_file: /tmp/play-root1.yaml
59 state: created
60 register: play4
61
62 - name: Check info
63 assert:
64 that:
65 - play4 is not changed
66
67 - name: Run with configmap
68 containers.podman.podman_play:
69 executable: "{{ test_executable | default('podman') }}"
70 kube_file: /tmp/play-root3.yaml
71 state: started
72 recreate: true
73 configmap:
74 - /tmp/envdata.yaml
75 register: play5
76
77 - name: Check info
78 assert:
79 that:
80 - play5 is changed
81
82 - name: Check if pod is running well
83 containers.podman.podman_pod_info:
84 executable: "{{ test_executable | default('podman') }}"
85 name: web-deploy-root-pod
86 register: info1
87
88 - name: Check pod info
89 assert:
90 that:
91 - info1['pods'][0]['State'] == 'Running'
92
93 always:
94
95 - name: Delete all pods leftovers from tests
96 containers.podman.podman_pod:
97 executable: "{{ test_executable | default('podman') }}"
98 name: "{{ item }}"
99 state: absent
100 loop:
101 - web-deploy
102 - web-deploy-pod
103 - web-deploy-pod-0
104 - web-deploy-pod-1
105 - web-deploy-pod-2