Skip to content

Commit 5b541bf

Browse files
authored
Merge pull request #110 from cloudscale-ch/test/kenneth/ansible-2.19
Add ansible-core 2.19+ compatibility
2 parents 3b29d8c + 5c7a821 commit 5b541bf

File tree

13 files changed

+142
-139
lines changed

13 files changed

+142
-139
lines changed

.github/workflows/ansible-collection-integration-tests.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,19 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
ansible:
24-
- 2.13
25-
- 2.14
26-
- 2.15
24+
- 2.13.0
25+
- 2.14.0
26+
- 2.15.0
27+
- 2.19.0b1
2728
include:
28-
- ansible: 2.13
29+
- ansible: 2.13.0
2930
python: 3.8
30-
- ansible: 2.14
31+
- ansible: 2.14.0
3132
python: 3.9
32-
- ansible: 2.15
33+
- ansible: 2.15.0
3334
python: 3.9
35+
- ansible: 2.19.0b1
36+
python: 3.12
3437
steps:
3538
- name: Check out code
3639
uses: actions/checkout@v4
@@ -46,7 +49,7 @@ jobs:
4649
run: |
4750
python -m pip install --upgrade pip
4851
# Install the latest ansible-core patchlevel version
49-
pip install 'ansible-core~=${{ matrix.ansible }}.0'
52+
pip install 'ansible-core~=${{ matrix.ansible }}'
5053
pip install -r tests/requirements.txt
5154
5255
- name: Build and install collection

tests/integration/targets/custom_image/tasks/tests.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
assert:
5858
that:
5959
- image1.import_status == 'success'
60-
- image1.name == "{{ cloudscale_resource_prefix }}-test-image"
60+
- image1.name == cloudscale_resource_prefix + '-test-image'
6161

6262
- name: Import a custom image (idempotency)
6363
cloudscale_ch.cloud.custom_image:
@@ -75,7 +75,7 @@
7575
assert:
7676
that:
7777
- image is not changed
78-
- image.name == "{{ cloudscale_resource_prefix }}-test-image"
78+
- image.name == cloudscale_resource_prefix + '-test-image'
7979
- image.uuid == image1.uuid
8080

8181
- name: Import a custom image with bad url
@@ -163,7 +163,7 @@
163163
assert:
164164
that:
165165
- image2 is changed
166-
- image2.name == "{{ cloudscale_resource_prefix }}-test-image2"
166+
- image2.name == cloudscale_resource_prefix + '-test-image2'
167167
- image2.uuid != image1.uuid
168168

169169
- name: Wait for import
@@ -178,7 +178,7 @@
178178
assert:
179179
that:
180180
- import_status is not changed
181-
- import_status.name == "{{ cloudscale_resource_prefix }}-test-image2"
181+
- import_status.name == cloudscale_resource_prefix + '-test-image2'
182182

183183
- name: Get image by name
184184
cloudscale_ch.cloud.custom_image:
@@ -198,7 +198,7 @@
198198
- name: Verify Change the name of an image
199199
assert:
200200
that:
201-
- change_name.name == "{{ cloudscale_resource_prefix }}-test-image-with-a-new-name"
201+
- change_name.name == cloudscale_resource_prefix + '-test-image-with-a-new-name'
202202
- change_name is changed
203203

204204
- name: Update slug of a custom image
@@ -219,7 +219,7 @@
219219
- name: Verify update slug of a custom image
220220
assert:
221221
that:
222-
- image.slug == "ansible-image-slug"
222+
- image.slug == 'ansible-image-slug'
223223

224224
- name: Update tags of a custom image
225225
cloudscale_ch.cloud.custom_image:
@@ -231,7 +231,7 @@
231231
assert:
232232
that:
233233
- image is changed
234-
- image.tags == "project: luna"
234+
- image.tags.project == 'luna'
235235

236236
- name: Update user_data_handling of a custom image
237237
cloudscale_ch.cloud.custom_image:
@@ -251,7 +251,7 @@
251251
- name: Verify update user_data_handling of a custom image
252252
assert:
253253
that:
254-
- image.user_data_handling == "extend-cloud-config"
254+
- image.user_data_handling == 'extend-cloud-config'
255255

256256
- name: Update slug, tags and user_data_handling of a custom image
257257
cloudscale_ch.cloud.custom_image:
@@ -265,9 +265,9 @@
265265
assert:
266266
that:
267267
- image is changed
268-
- image.slug == "yet-another-slug"
269-
- image.tags == "project: jupiter"
270-
- image.user_data_handling == "pass-through"
268+
- image.slug == 'yet-another-slug'
269+
- image.tags.project == 'jupiter'
270+
- image.user_data_handling == 'pass-through'
271271

272272
- name: List all custom images, there should be two
273273
uri:
@@ -279,7 +279,7 @@
279279
- name: Verify that two custom images are created by this test run
280280
assert:
281281
that:
282-
- image_list.json | selectattr("name","search", "{{ cloudscale_resource_prefix }}" ) | list | length == 2
282+
- image_list.json | selectattr("name","search", cloudscale_resource_prefix) | list | length == 2
283283

284284
- name: Delete image by uuid
285285
cloudscale_ch.cloud.custom_image:
@@ -312,7 +312,7 @@
312312
- name: Verify that the two custom images of this test run are deleted
313313
assert:
314314
that:
315-
- image_list.json | selectattr("name","search", "{{ cloudscale_resource_prefix }}" ) | list | length == 0
315+
- image_list.json | selectattr("name","search", cloudscale_resource_prefix) | list | length == 0
316316

317317
- name: Import a custom image
318318
cloudscale_ch.cloud.custom_image:
@@ -395,7 +395,7 @@
395395
assert:
396396
that:
397397
- image1_uefi.import_status == 'success'
398-
- image1_uefi.name == "{{ cloudscale_resource_prefix }}-test-image-uefi"
398+
- image1_uefi.name == cloudscale_resource_prefix + '-test-image-uefi'
399399

400400
- name: Fail changing the firmware type of an already imported image from uefi to bios
401401
cloudscale_ch.cloud.custom_image:

tests/integration/targets/load_balancer/tasks/tests.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
that:
3737
- load_balancer is changed
3838
- load_balancer.status == 'running'
39-
- load_balancer.name == cloudscale_resource_prefix + "-test"
39+
- load_balancer.name == cloudscale_resource_prefix + '-test'
4040
- load_balancer.flavor.slug == cloudscale_test_flavor_lb
4141
- load_balancer.vip_addresses[0].subnet.uuid == snet.uuid
4242
- load_balancer.zone.slug == cloudscale_test_zone
@@ -61,7 +61,7 @@
6161
that:
6262
- load_balancer is not changed
6363
- load_balancer.status == 'running'
64-
- load_balancer.name == cloudscale_resource_prefix + "-test"
64+
- load_balancer.name == cloudscale_resource_prefix + '-test'
6565
- load_balancer.flavor.slug == cloudscale_test_flavor_lb
6666
- load_balancer.vip_addresses[0].subnet.uuid == snet.uuid
6767
- load_balancer.zone.slug == cloudscale_test_zone
@@ -79,7 +79,7 @@
7979
that:
8080
- load_balancer_default_flavor is changed
8181
- load_balancer_default_flavor.status == 'running'
82-
- load_balancer_default_flavor.name == cloudscale_resource_prefix + "-test2"
82+
- load_balancer_default_flavor.name == cloudscale_resource_prefix + '-test2'
8383
- load_balancer_default_flavor.flavor.slug == cloudscale_test_flavor_lb
8484
- load_balancer_default_flavor.zone.slug == cloudscale_test_zone
8585

@@ -92,7 +92,7 @@
9292
assert:
9393
that:
9494
- load_balancer is not changed
95-
- load_balancer.name == cloudscale_resource_prefix + "-test"
95+
- load_balancer.name == cloudscale_resource_prefix + '-test'
9696

9797
# Update running LB
9898
- name: Test update name and tags of a running load balancer in check mode
@@ -110,7 +110,7 @@
110110
that:
111111
- load_balancer is changed
112112
- load_balancer.status == 'running'
113-
- load_balancer.name == cloudscale_resource_prefix + "-test"
113+
- load_balancer.name == cloudscale_resource_prefix + '-test'
114114

115115
- name: Test update name and tags of a running load balancer
116116
cloudscale_ch.cloud.load_balancer:
@@ -126,7 +126,7 @@
126126
that:
127127
- load_balancer is changed
128128
- load_balancer.status == 'running'
129-
- load_balancer.name == cloudscale_resource_prefix + "-test-renamed"
129+
- load_balancer.name == cloudscale_resource_prefix + '-test-renamed'
130130
- load_balancer.flavor.slug == cloudscale_test_flavor_lb
131131
- load_balancer.tags.project == 'ansible-test'
132132
- load_balancer.tags.stage == 'staging'
@@ -146,7 +146,7 @@
146146
that:
147147
- load_balancer is not changed
148148
- load_balancer.status == 'running'
149-
- load_balancer.name == cloudscale_resource_prefix + "-test-renamed"
149+
- load_balancer.name == cloudscale_resource_prefix + '-test-renamed'
150150
- load_balancer.flavor.slug == cloudscale_test_flavor_lb
151151
- load_balancer.tags.project == 'ansible-test'
152152
- load_balancer.tags.stage == 'staging'

tests/integration/targets/load_balancer_listener/tasks/tests.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
assert:
4646
that:
4747
- load_balancer_listener is changed
48-
- load_balancer_listener.name == cloudscale_resource_prefix + "-test"
48+
- load_balancer_listener.name == cloudscale_resource_prefix + '-test'
4949
- load_balancer_listener.pool.uuid == load_balancer_pool.uuid
5050
- load_balancer_listener.protocol == cloudscale_test_listener_protocol
5151
- load_balancer_listener.protocol_port == cloudscale_test_protocol_port
@@ -79,7 +79,7 @@
7979
assert:
8080
that:
8181
- load_balancer_listener is not changed
82-
- load_balancer_listener.name == cloudscale_resource_prefix + "-test"
82+
- load_balancer_listener.name == cloudscale_resource_prefix + '-test'
8383
- load_balancer_listener.pool.uuid == load_balancer_pool.uuid
8484
- load_balancer_listener.protocol == cloudscale_test_listener_protocol
8585
- load_balancer_listener.protocol_port == cloudscale_test_protocol_port
@@ -101,7 +101,7 @@
101101
assert:
102102
that:
103103
- load_balancer_listener is not changed
104-
- load_balancer_listener.name == '{{ cloudscale_resource_prefix }}-test'
104+
- load_balancer_listener.name == cloudscale_resource_prefix + '-test'
105105

106106
# Update an existing LB listener
107107
- name: Test update a load balancer listener in check mode
@@ -127,7 +127,7 @@
127127
assert:
128128
that:
129129
- load_balancer_listener is changed
130-
- load_balancer_listener.name == cloudscale_resource_prefix + "-test"
130+
- load_balancer_listener.name == cloudscale_resource_prefix + '-test'
131131
- load_balancer_listener.pool.uuid == load_balancer_pool.uuid
132132
- load_balancer_listener.protocol == cloudscale_test_listener_protocol
133133
- load_balancer_listener.protocol_port == cloudscale_test_protocol_port
@@ -162,7 +162,7 @@
162162
assert:
163163
that:
164164
- load_balancer_listener is changed
165-
- load_balancer_listener.name == cloudscale_resource_prefix + "-test-renamed"
165+
- load_balancer_listener.name == cloudscale_resource_prefix + '-test-renamed'
166166
- load_balancer_listener.pool.uuid == load_balancer_pool.uuid
167167
- load_balancer_listener.protocol == cloudscale_test_listener_protocol
168168
- load_balancer_listener.protocol_port == cloudscale_test_protocol_port
@@ -198,7 +198,7 @@
198198
assert:
199199
that:
200200
- load_balancer_listener is not changed
201-
- load_balancer_listener.name == cloudscale_resource_prefix + "-test-renamed"
201+
- load_balancer_listener.name == cloudscale_resource_prefix + '-test-renamed'
202202
- load_balancer_listener.pool.uuid == load_balancer_pool.uuid
203203
- load_balancer_listener.protocol == cloudscale_test_listener_protocol
204204
- load_balancer_listener.protocol_port == cloudscale_test_protocol_port
@@ -223,7 +223,7 @@
223223
assert:
224224
that:
225225
- load_balancer_listener is changed
226-
- load_balancer_listener.name == cloudscale_resource_prefix + "-test-renamed"
226+
- load_balancer_listener.name == cloudscale_resource_prefix + '-test-renamed'
227227

228228
- name: Test load balancer listener deletion by name
229229
cloudscale_ch.cloud.load_balancer_listener:

tests/integration/targets/load_balancer_pool/tasks/tests.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
assert:
3434
that:
3535
- load_balancer_pool is changed
36-
- load_balancer_pool.name == cloudscale_resource_prefix + "-test"
36+
- load_balancer_pool.name == cloudscale_resource_prefix + '-test'
3737
- load_balancer_pool.load_balancer.uuid == load_balancer.uuid
3838
- load_balancer_pool.tags.project == 'ansible-test'
3939
- load_balancer_pool.tags.stage == 'production'
@@ -54,7 +54,7 @@
5454
assert:
5555
that:
5656
- load_balancer_pool is not changed
57-
- load_balancer_pool.name == cloudscale_resource_prefix + "-test"
57+
- load_balancer_pool.name == cloudscale_resource_prefix + '-test'
5858
- load_balancer_pool.load_balancer.uuid == load_balancer.uuid
5959
- load_balancer_pool.tags.project == 'ansible-test'
6060
- load_balancer_pool.tags.stage == 'production'
@@ -69,7 +69,7 @@
6969
assert:
7070
that:
7171
- load_balancer_pool is not changed
72-
- load_balancer_pool.name == cloudscale_resource_prefix + "-test"
72+
- load_balancer_pool.name == cloudscale_resource_prefix + '-test'
7373

7474
# Update LB Pool
7575
- name: Test update name and tags of a running load balancer pool in check mode
@@ -86,7 +86,7 @@
8686
assert:
8787
that:
8888
- load_balancer_pool is changed
89-
- load_balancer_pool.name == cloudscale_resource_prefix + "-test"
89+
- load_balancer_pool.name == cloudscale_resource_prefix + '-test'
9090

9191
- name: Test update name and tags of a running load balancer pool
9292
cloudscale_ch.cloud.load_balancer_pool:
@@ -101,7 +101,7 @@
101101
assert:
102102
that:
103103
- load_balancer_pool is changed
104-
- load_balancer_pool.name == cloudscale_resource_prefix + "-test-renamed"
104+
- load_balancer_pool.name == cloudscale_resource_prefix + '-test-renamed'
105105
- load_balancer_pool.tags.project == 'ansible-test'
106106
- load_balancer_pool.tags.stage == 'staging'
107107
- load_balancer_pool.tags.sla == '8-5'
@@ -119,7 +119,7 @@
119119
assert:
120120
that:
121121
- load_balancer_pool is not changed
122-
- load_balancer_pool.name == cloudscale_resource_prefix + "-test-renamed"
122+
- load_balancer_pool.name == cloudscale_resource_prefix + '-test-renamed'
123123
- load_balancer_pool.tags.project == 'ansible-test'
124124
- load_balancer_pool.tags.stage == 'staging'
125125
- load_balancer_pool.tags.sla == '8-5'

0 commit comments

Comments
 (0)