Debian Codegraph @

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

raw
1 ---
2 # Ulimits testing
3 - name: Make sure container doesn't exist
4 containers.podman.podman_container:
5 executable: "{{ test_executable | default('podman') }}"
6 name: root-idempotency
7 state: absent
8
9 - name: Run container as is
10 containers.podman.podman_container:
11 executable: "{{ test_executable | default('podman') }}"
12 image: "{{ idem_image }}"
13 name: root-idempotency
14 state: started
15 command: 1h
16
17 - name: Run container as is again
18 containers.podman.podman_container:
19 executable: "{{ test_executable | default('podman') }}"
20 image: "{{ idem_image }}"
21 name: root-idempotency
22 state: present
23 command: 1h
24 register: info_a
25
26 - name: Check that it is not recreated
27 assert:
28 that:
29 - info_a is not changed
30
31 - name: Run containers with ulimits
32 containers.podman.podman_container:
33 executable: "{{ test_executable | default('podman') }}"
34 image: "{{ idem_image }}"
35 name: root-idempotency
36 state: present
37 command: 1h
38 ulimit:
39 - 'nofile=55535:55535'
40 - 'memlock=-1:-1'
41 register: info
42
43 - name: Check that it is recreated
44 assert:
45 that:
46 - info is changed
47
48 - name: Run containers with ulimits - idempotency
49 containers.podman.podman_container:
50 executable: "{{ test_executable | default('podman') }}"
51 image: "{{ idem_image }}"
52 name: root-idempotency
53 state: present
54 command: 1h
55 ulimit:
56 - 'nofile=55535:55535'
57 - 'memlock=-1:-1'
58 register: info1
59
60 - name: Check that it is recreated
61 assert:
62 that:
63 - info1 is not changed
64
65 - name: Run containers with changed ulimits
66 containers.podman.podman_container:
67 executable: "{{ test_executable | default('podman') }}"
68 image: "{{ idem_image }}"
69 name: root-idempotency
70 state: present
71 command: 1h
72 ulimit:
73 - 'nofile=55535:65535'
74 - 'memlock=-1:-1'
75 register: info2
76
77 - name: Check that it is recreated
78 assert:
79 that:
80 - info2 is changed
81
82 - name: Run containers with changed ulimits - idempotency
83 containers.podman.podman_container:
84 executable: "{{ test_executable | default('podman') }}"
85 image: "{{ idem_image }}"
86 name: root-idempotency
87 state: present
88 command: 1h
89 ulimit:
90 - 'nofile=55535:65535'
91 - 'memlock=-1:-1'
92 register: info3
93
94 - name: Check that it is recreated
95 assert:
96 that:
97 - info3 is not changed
98
99 - name: Run default container
100 containers.podman.podman_container:
101 executable: "{{ test_executable | default('podman') }}"
102 image: "{{ idem_image }}"
103 name: root-idempotency
104 state: started
105 command: 1h
106
107 - name: Run containers with MAC address
108 containers.podman.podman_container:
109 executable: "{{ test_executable | default('podman') }}"
110 image: "{{ idem_image }}"
111 name: root-idempotency
112 state: started
113 command: 1h
114 mac_address: 44:55:66:77:88:99
115 register: info4
116
117 - name: Check that it is not recreated
118 assert:
119 that:
120 - info4 is changed
121 - info4.container['NetworkSettings']['MacAddress'] == '44:55:66:77:88:99'
122
123 - name: Run containers with MAC address again - idempotency
124 containers.podman.podman_container:
125 executable: "{{ test_executable | default('podman') }}"
126 image: "{{ idem_image }}"
127 name: root-idempotency
128 state: present
129 command: 1h
130 mac_address: 44:55:66:77:88:99
131 register: info5
132
133 - name: Check that it is not recreated
134 assert:
135 that:
136 - info5 is not changed
137
138 - name: Run containers with MAC address changed
139 containers.podman.podman_container:
140 executable: "{{ test_executable | default('podman') }}"
141 image: "{{ idem_image }}"
142 name: root-idempotency
143 state: present
144 command: 1h
145 mac_address: 44:55:66:77:88:33
146 register: info6
147
148 - name: Check that it is recreated
149 assert:
150 that:
151 - info6 is changed
152
153 - name: Run again default container
154 containers.podman.podman_container:
155 executable: "{{ test_executable | default('podman') }}"
156 image: "{{ idem_image }}"
157 name: root-idempotency
158 state: present
159 command: 1h
160 register: info7
161
162 - name: Check that it is recreated
163 assert:
164 that:
165 - info7 is changed
166
167 - name: Run container with publishing ports and ipv6
168 containers.podman.podman_container:
169 executable: "{{ test_executable | default('podman') }}"
170 image: "{{ idem_image }}"
171 name: root-idempotency
172 state: present
173 command: 1h
174 ports:
175 - "4444:4444/tcp"
176 - "1212:5555"
177 - "8888:19191/udp"
178 - "127.0.0.1:7671:7676/udp"
179 - "127.0.0.3:43423:8872"
180 - "[::1]:34523:35425"
181 - "40001-40010"
182 register: info8
183
184 - name: Check that it is recreated
185 assert:
186 that:
187 - info8 is changed
188
189 - name: Run container with publishing ports and ipv6 again
190 containers.podman.podman_container:
191 executable: "{{ test_executable | default('podman') }}"
192 image: "{{ idem_image }}"
193 name: root-idempotency
194 state: present
195 command: 1h
196 ports:
197 - "4444:4444/tcp"
198 - "1212:5555"
199 - "8888:19191/udp"
200 - "127.0.0.1:7671:7676/udp"
201 - "127.0.0.3:43423:8872"
202 - "[::1]:34523:35425"
203 - "40001-40010"
204 register: info9
205
206 - name: Check that it is recreated
207 assert:
208 that:
209 - info9 is not changed
210
211 - name: Make sure container doesn't exist
212 containers.podman.podman_container:
213 executable: "{{ test_executable | default('podman') }}"
214 name: root-idempotency
215 state: absent