-
-
Notifications
You must be signed in to change notification settings - Fork 149
/
idem_volumes.yml
234 lines (196 loc) · 4.41 KB
/
idem_volumes.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# Volumes
- containers.podman.podman_container:
name: idempotency
state: absent
- containers.podman.podman_container:
image: "{{ idem_image }}"
name: idempotency
state: started
command: 1h
- containers.podman.podman_container:
image: "{{ idem_image }}"
name: idempotency
state: present
command: 1h
register: test1
- name: check test1
assert:
that: test1 is not changed
- containers.podman.podman_container:
image: "{{ idem_image }}"
name: idempotency
state: present
command: 1h
register: test2
- name: check test2
assert:
that: test2 is not changed
- containers.podman.podman_container:
image: "{{ idem_image }}"
name: idempotency
state: present
command: 1h
register: test3
- name: check test3
assert:
that: test3 is not changed
- containers.podman.podman_container:
image: "{{ idem_image }}"
name: idempotency
state: present
volumes:
- /opt:/somedir/
command: 1h
register: test4
- name: check test4
assert:
that: test4 is changed
- containers.podman.podman_container:
image: "{{ idem_image }}"
name: idempotency
state: present
volumes:
- /opt/://somedir/
command: 1h
register: test5
- name: check test5
assert:
that: test5 is not changed
- containers.podman.podman_container:
image: "{{ idem_image }}"
name: idempotency
state: present
command: 1h
register: test6
- name: check test6
assert:
that: test6 is changed
- containers.podman.podman_container:
image: "{{ idem_image }}"
name: idempotency
state: present
volumes:
- /opt:/somedir
- /data
command: 1h
register: test7
- name: check test7
assert:
that: test7 is changed
- containers.podman.podman_container:
image: "{{ idem_image }}"
name: idempotency
state: present
volumes:
- /data
command: 1h
register: test8
- name: check test8
assert:
that: test8 is changed
- containers.podman.podman_container:
image: "{{ idem_image }}"
name: idempotency
state: present
command: 1h
register: test9
- name: check test9
assert:
that: test9 is not changed
- name: Create volumes
shell: |
podman volume inspect local_volume1 || podman volume create local_volume1
podman volume inspect local_volume2 || podman volume create local_volume2
- containers.podman.podman_container:
image: "{{ idem_image }}"
name: idempotency
state: present
command: 1h
volumes:
- "/opt:/anotherdir"
- "local_volume1:/data"
register: test10
- name: check test10
assert:
that: test10 is changed
- containers.podman.podman_container:
image: "{{ idem_image }}"
name: idempotency
state: present
command: 1h
volumes:
- "/opt//:/anotherdir"
- "local_volume1:/data/"
register: test11
- name: check test11
assert:
that: test11 is not changed
- containers.podman.podman_container:
image: "{{ idem_image }}"
name: idempotency
state: present
command: 1h
volumes:
- "/opt:/anotherdir"
- "local_volume2:/data"
register: test12
- name: check test12
assert:
that: test12 is changed
- containers.podman.podman_container:
image: "{{ idem_image }}"
name: idempotency
state: present
command: 1h
volumes:
- "/opt:/anotherdir"
register: test13
- name: check test13
assert:
that: test13 is not changed
- containers.podman.podman_container:
name: idempotency1
state: absent
- containers.podman.podman_container:
image: alpine
name: idempotency1
state: present
command: sleep 1h
- containers.podman.podman_container:
image: alpine
name: idempotency1
state: present
command: sleep 1h
register: test14
- name: check test14
assert:
that: test14 is not changed
- containers.podman.podman_container:
image: alpine
name: idempotency1
state: present
volumes:
- /opt:/data
command: sleep 1h
register: test15
- name: check test15
assert:
that: test15 is changed
- containers.podman.podman_container:
image: alpine
name: idempotency1
state: present
command: sleep 1h
register: test16
- name: check test16
assert:
that: test16 is changed
- containers.podman.podman_container:
image: alpine
name: idempotency1
state: present
command: sleep 1h
register: test17
- name: check test17
assert:
that: test17 is not changed