Debian Codegraph @

ansible_collections/amazon/aws/tests/integration/targets/route53_health_check/tasks/main.yml

raw
1 ---
2 # route53_health_check integration tests
3 #
4 # Module uses the following as an 'ID'
5 # (the real ID is automatically assigned after creation)
6 # - ip_address
7 # - fqdn
8 # - port
9 # - type (immutable)
10 # - request_interval (immutable)
11 #
12 # modifiable
13 # - resource_path
14 # - string_match
15 # - failure_threshold
16 # - disabled
17 #
18 - module_defaults:
19 group/aws:
20 access_key: "{{ aws_access_key }}"
21 secret_key: "{{ aws_secret_key }}"
22 session_token: "{{ security_token | default(omit) }}"
23 region: "{{ aws_region }}"
24 block:
25 # Route53 can only test against routable IPs. Request an EIP so some poor
26 # soul doesn't get randomly hit by our testing.
27 - name: Allocate an EIP we can test against
28 amazon.aws.ec2_eip:
29 state: present
30 register: eip
31
32 - ansible.builtin.set_fact:
33 ip_address: "{{ eip.public_ip }}"
34
35 - name: Run tests for create and delete health check with tags and name as unique identifier
36 ansible.builtin.include_tasks: named_health_check_tag_operations.yml
37 - name: Run tests for creating multiple health checks with name as unique identifier
38 ansible.builtin.include_tasks: create_multiple_health_checks.yml
39 - name: Run tests for update and delete health check by ID
40 ansible.builtin.include_tasks: update_delete_by_id.yml
41 - name: Run tests for create, update, and delete calculated health check
42 ansible.builtin.include_tasks: calculate_health_check.yml
43 - name: Create a TCP health check - check_mode
44 amazon.aws.route53_health_check:
45 state: present
46 ip_address: "{{ ip_address }}"
47 port: "{{ check_port }}"
48 type: "{{ type }}"
49 register: create_check
50 check_mode: true
51
52 - name: Check result - Create a TCP health check - check_mode
53 ansible.builtin.assert:
54 that:
55 - create_check is successful
56 - create_check is changed
57
58 - name: Create a TCP health check
59 amazon.aws.route53_health_check:
60 state: present
61 ip_address: "{{ ip_address }}"
62 port: "{{ check_port }}"
63 type: "{{ type }}"
64 register: create_check
65
66 - name: Check result - Create a TCP health check
67 ansible.builtin.assert:
68 that:
69 - create_check is successful
70 - create_check is changed
71 - '"health_check" in create_check'
72 - '"id" in _health_check'
73 - '"action" in _health_check'
74 - '"health_check_version" in _health_check'
75 - '"tags" in _health_check'
76 - create_check.health_check.action == 'create'
77 - '"health_check_config" in create_check.health_check'
78 - '"type" in _check_config'
79 - '"disabled" in _check_config'
80 - '"failure_threshold" in _check_config'
81 - '"request_interval" in _check_config'
82 - '"fully_qualified_domain_name" not in _check_config'
83 - '"ip_address" in _check_config'
84 - '"port" in _check_config'
85 - '"resource_path" not in _check_config'
86 - '"search_string" not in _check_config'
87 - _check_config.disabled == false
88 - _check_config.type == 'TCP'
89 - _check_config.failure_threshold == 3
90 - _check_config.request_interval == 30
91 - _check_config.ip_address == ip_address
92 - _check_config.port == check_port
93 vars:
94 _health_check: "{{ create_check.health_check }}"
95 _check_config: "{{ _health_check.health_check_config }}"
96
97 - ansible.builtin.set_fact:
98 tcp_check_id: "{{ create_check.health_check.id }}"
99
100 - name: Create a TCP health check - idempotency - check_mode
101 amazon.aws.route53_health_check:
102 state: present
103 ip_address: "{{ ip_address }}"
104 port: "{{ check_port }}"
105 type: "{{ type }}"
106 register: create_check
107 check_mode: true
108
109 - name: Check result - Create a TCP health check - idempotency - check_mode
110 ansible.builtin.assert:
111 that:
112 - create_check is successful
113 - create_check is not changed
114
115 - name: Create a TCP health check - idempotency
116 amazon.aws.route53_health_check:
117 state: present
118 ip_address: "{{ ip_address }}"
119 port: "{{ check_port }}"
120 type: "{{ type }}"
121 register: create_check
122
123 - name: Check result - Create a TCP health check - idempotency
124 ansible.builtin.assert:
125 that:
126 - create_check is successful
127 - create_check is not changed
128 - '"health_check" in create_check'
129 - '"id" in create_check.health_check'
130 - _health_check.id == tcp_check_id
131 - '"id" in _health_check'
132 - '"action" in _health_check'
133 - '"health_check_version" in _health_check'
134 - '"tags" in _health_check'
135 - create_check.health_check.action is none
136 - '"health_check_config" in create_check.health_check'
137 - '"type" in _check_config'
138 - '"disabled" in _check_config'
139 - '"failure_threshold" in _check_config'
140 - '"request_interval" in _check_config'
141 - '"fully_qualified_domain_name" not in _check_config'
142 - '"ip_address" in _check_config'
143 - '"port" in _check_config'
144 - '"resource_path" not in _check_config'
145 - '"search_string" not in _check_config'
146 - _check_config.disabled == false
147 - _check_config.type == 'TCP'
148 - _check_config.request_interval == 30
149 - _check_config.failure_threshold == 3
150 - _check_config.ip_address == ip_address
151 - _check_config.port == check_port
152 vars:
153 _health_check: "{{ create_check.health_check }}"
154 _check_config: "{{ _health_check.health_check_config }}"
155
156 # Update an attribute
157 - name: Update TCP health check - set threshold - check_mode
158 amazon.aws.route53_health_check:
159 state: present
160 ip_address: "{{ ip_address }}"
161 port: "{{ check_port }}"
162 type: "{{ type }}"
163 failure_threshold: "{{ failure_threshold_updated }}"
164 register: update_threshold
165 check_mode: true
166
167 - name: Check result - Update TCP health check - set threshold - check_mode
168 ansible.builtin.assert:
169 that:
170 - update_threshold is successful
171 - update_threshold is changed
172
173 - name: Update TCP health check - set threshold
174 amazon.aws.route53_health_check:
175 state: present
176 ip_address: "{{ ip_address }}"
177 port: "{{ check_port }}"
178 type: "{{ type }}"
179 failure_threshold: "{{ failure_threshold_updated }}"
180 register: update_threshold
181
182 - name: Check result - Update TCP health check - set threshold
183 ansible.builtin.assert:
184 that:
185 - update_threshold is successful
186 - update_threshold is changed
187 - '"health_check" in update_threshold'
188 - '"id" in _health_check'
189 - _health_check.id == tcp_check_id
190 - '"action" in _health_check'
191 - '"health_check_version" in _health_check'
192 - '"tags" in _health_check'
193 - _health_check.action == 'update'
194 - '"health_check_config" in _health_check'
195 - '"type" in _check_config'
196 - '"disabled" in _check_config'
197 - '"failure_threshold" in _check_config'
198 - '"request_interval" in _check_config'
199 - '"fully_qualified_domain_name" not in _check_config'
200 - '"ip_address" in _check_config'
201 - '"port" in _check_config'
202 - '"resource_path" not in _check_config'
203 - '"search_string" not in _check_config'
204 - _check_config.disabled == false
205 - _check_config.type == 'TCP'
206 - _check_config.request_interval == 30
207 - _check_config.failure_threshold == failure_threshold_updated
208 - _check_config.ip_address == ip_address
209 - _check_config.port == check_port
210 vars:
211 _health_check: "{{ update_threshold.health_check }}"
212 _check_config: "{{ _health_check.health_check_config }}"
213
214 - name: Update TCP health check - set threshold - idempotency - check_mode
215 amazon.aws.route53_health_check:
216 state: present
217 ip_address: "{{ ip_address }}"
218 port: "{{ check_port }}"
219 type: "{{ type }}"
220 failure_threshold: "{{ failure_threshold_updated }}"
221 register: update_threshold
222 check_mode: true
223
224 - name: Check result - Update TCP health check - set threshold - idempotency - check_mode
225 ansible.builtin.assert:
226 that:
227 - update_threshold is successful
228 - update_threshold is not changed
229
230 - name: Update TCP health check - set threshold - idempotency
231 amazon.aws.route53_health_check:
232 state: present
233 ip_address: "{{ ip_address }}"
234 port: "{{ check_port }}"
235 type: "{{ type }}"
236 failure_threshold: "{{ failure_threshold_updated }}"
237 register: update_threshold
238
239 - name: Check result - Update TCP health check - set threshold - idempotency
240 ansible.builtin.assert:
241 that:
242 - update_threshold is successful
243 - update_threshold is not changed
244 - '"health_check" in update_threshold'
245 - '"id" in _health_check'
246 - _health_check.id == tcp_check_id
247 - '"action" in _health_check'
248 - '"health_check_version" in _health_check'
249 - '"tags" in _health_check'
250 - _health_check.action is none
251 - '"health_check_config" in _health_check'
252 - '"type" in _check_config'
253 - '"disabled" in _check_config'
254 - '"failure_threshold" in _check_config'
255 - '"request_interval" in _check_config'
256 - '"fully_qualified_domain_name" not in _check_config'
257 - '"ip_address" in _check_config'
258 - '"port" in _check_config'
259 - '"resource_path" not in _check_config'
260 - '"search_string" not in _check_config'
261 - _check_config.disabled == false
262 - _check_config.type == 'TCP'
263 - _check_config.request_interval == 30
264 - _check_config.failure_threshold == failure_threshold_updated
265 - _check_config.ip_address == ip_address
266 - _check_config.port == check_port
267 vars:
268 _health_check: "{{ update_threshold.health_check }}"
269 _check_config: "{{ _health_check.health_check_config }}"
270
271 - name: Update TCP health check - set disabled - check_mode
272 amazon.aws.route53_health_check:
273 state: present
274 ip_address: "{{ ip_address }}"
275 port: "{{ check_port }}"
276 type: "{{ type }}"
277 disabled: true
278 register: update_disabled
279 check_mode: true
280
281 - name: Check result - Update TCP health check - set disabled - check_mode
282 ansible.builtin.assert:
283 that:
284 - update_disabled is successful
285 - update_disabled is changed
286
287 - name: Update TCP health check - set disabled
288 amazon.aws.route53_health_check:
289 state: present
290 ip_address: "{{ ip_address }}"
291 port: "{{ check_port }}"
292 type: "{{ type }}"
293 disabled: true
294 register: update_disabled
295
296 - name: Check result - Update TCP health check - set disabled
297 ansible.builtin.assert:
298 that:
299 - update_disabled is successful
300 - update_disabled is changed
301 - '"health_check" in update_disabled'
302 - '"id" in _health_check'
303 - _health_check.id == tcp_check_id
304 - '"action" in _health_check'
305 - '"health_check_version" in _health_check'
306 - '"tags" in _health_check'
307 - _health_check.action == 'update'
308 - '"health_check_config" in _health_check'
309 - '"type" in _check_config'
310 - '"disabled" in _check_config'
311 - '"failure_threshold" in _check_config'
312 - '"request_interval" in _check_config'
313 - '"fully_qualified_domain_name" not in _check_config'
314 - '"ip_address" in _check_config'
315 - '"port" in _check_config'
316 - '"resource_path" not in _check_config'
317 - '"search_string" not in _check_config'
318 - _check_config.disabled == true
319 - _check_config.type == 'TCP'
320 - _check_config.request_interval == 30
321 - _check_config.failure_threshold == failure_threshold_updated
322 - _check_config.ip_address == ip_address
323 - _check_config.port == check_port
324 vars:
325 _health_check: "{{ update_disabled.health_check }}"
326 _check_config: "{{ _health_check.health_check_config }}"
327
328 - name: Update TCP health check - set disabled - idempotency - check_mode
329 amazon.aws.route53_health_check:
330 state: present
331 ip_address: "{{ ip_address }}"
332 port: "{{ check_port }}"
333 type: "{{ type }}"
334 disabled: true
335 register: update_disabled
336 check_mode: true
337
338 - name: Check result - Update TCP health check - set disabled - idempotency - check_mode
339 ansible.builtin.assert:
340 that:
341 - update_disabled is successful
342 - update_disabled is not changed
343
344 - name: Update TCP health check - set disabled - idempotency
345 amazon.aws.route53_health_check:
346 state: present
347 ip_address: "{{ ip_address }}"
348 port: "{{ check_port }}"
349 type: "{{ type }}"
350 disabled: true
351 register: update_disabled
352
353 - name: Check result - Update TCP health check - set disabled - idempotency
354 ansible.builtin.assert:
355 that:
356 - update_disabled is successful
357 - update_disabled is not changed
358 - '"health_check" in update_disabled'
359 - '"id" in _health_check'
360 - _health_check.id == tcp_check_id
361 - '"action" in _health_check'
362 - '"health_check_version" in _health_check'
363 - '"tags" in _health_check'
364 - _health_check.action is none
365 - '"health_check_config" in _health_check'
366 - '"type" in _check_config'
367 - '"disabled" in _check_config'
368 - '"failure_threshold" in _check_config'
369 - '"request_interval" in _check_config'
370 - '"fully_qualified_domain_name" not in _check_config'
371 - '"ip_address" in _check_config'
372 - '"port" in _check_config'
373 - '"resource_path" not in _check_config'
374 - '"search_string" not in _check_config'
375 - _check_config.disabled == true
376 - _check_config.type == 'TCP'
377 - _check_config.request_interval == 30
378 - _check_config.failure_threshold == failure_threshold_updated
379 - _check_config.ip_address == ip_address
380 - _check_config.port == check_port
381 vars:
382 _health_check: "{{ update_disabled.health_check }}"
383 _check_config: "{{ _health_check.health_check_config }}"
384
385 - name: Update TCP health check - set tags - check_mode
386 amazon.aws.route53_health_check:
387 state: present
388 ip_address: "{{ ip_address }}"
389 port: "{{ check_port }}"
390 type: "{{ type }}"
391 tags:
392 CamelCase: CamelCaseValue
393 snake_case: snake_case_value
394 with space: Some value
395 purge_tags: false
396 register: update_tags
397 check_mode: true
398
399 - name: Check result - Update TCP health check - set tags - check_mode
400 ansible.builtin.assert:
401 that:
402 - update_tags is successful
403 - update_tags is changed
404
405 - name: Update TCP health check - set tags
406 amazon.aws.route53_health_check:
407 state: present
408 ip_address: "{{ ip_address }}"
409 port: "{{ check_port }}"
410 type: "{{ type }}"
411 tags:
412 CamelCase: CamelCaseValue
413 snake_case: snake_case_value
414 with space: Some value
415 purge_tags: false
416 register: update_tags
417
418 - name: Check result - Update TCP health check - set tags
419 ansible.builtin.assert:
420 that:
421 - update_tags is successful
422 - update_tags is changed
423 - '"health_check" in update_tags'
424 - '"id" in _health_check'
425 - _health_check.id == tcp_check_id
426 - '"action" in _health_check'
427 - '"health_check_version" in _health_check'
428 - '"tags" in _health_check'
429 - '"CamelCase" in _health_check.tags'
430 - _health_check.tags['CamelCase'] == 'CamelCaseValue'
431 - '"snake_case" in _health_check.tags'
432 - _health_check.tags['snake_case'] == 'snake_case_value'
433 - '"with space" in _health_check.tags'
434 - _health_check.tags['with space'] == 'Some value'
435 - _health_check.action is none
436 - '"health_check_config" in _health_check'
437 - '"type" in _check_config'
438 - '"disabled" in _check_config'
439 - '"failure_threshold" in _check_config'
440 - '"request_interval" in _check_config'
441 - '"fully_qualified_domain_name" not in _check_config'
442 - '"ip_address" in _check_config'
443 - '"port" in _check_config'
444 - '"resource_path" not in _check_config'
445 - '"search_string" not in _check_config'
446 - _check_config.disabled == true
447 - _check_config.type == 'TCP'
448 - _check_config.request_interval == 30
449 - _check_config.failure_threshold == failure_threshold_updated
450 - _check_config.ip_address == ip_address
451 - _check_config.port == check_port
452 vars:
453 _health_check: "{{ update_tags.health_check }}"
454 _check_config: "{{ _health_check.health_check_config }}"
455
456 - name: Update TCP health check - set tags - idempotency - check_mode
457 amazon.aws.route53_health_check:
458 state: present
459 ip_address: "{{ ip_address }}"
460 port: "{{ check_port }}"
461 type: "{{ type }}"
462 tags:
463 CamelCase: CamelCaseValue
464 snake_case: snake_case_value
465 with space: Some value
466 purge_tags: false
467 register: update_tags
468 check_mode: true
469
470 - name: Check result - Update TCP health check - set tags - idempotency - check_mode
471 ansible.builtin.assert:
472 that:
473 - update_tags is successful
474 - update_tags is not changed
475
476 - name: Update TCP health check - set tags - idempotency
477 amazon.aws.route53_health_check:
478 state: present
479 ip_address: "{{ ip_address }}"
480 port: "{{ check_port }}"
481 type: "{{ type }}"
482 tags:
483 CamelCase: CamelCaseValue
484 snake_case: snake_case_value
485 with space: Some value
486 purge_tags: false
487 register: update_tags
488
489 - name: Check result - Update TCP health check - set tags - idempotency
490 ansible.builtin.assert:
491 that:
492 - update_tags is successful
493 - update_tags is not changed
494 - '"health_check" in update_tags'
495 - '"id" in _health_check'
496 - _health_check.id == tcp_check_id
497 - '"action" in _health_check'
498 - '"health_check_version" in _health_check'
499 - '"tags" in _health_check'
500 - '"CamelCase" in _health_check.tags'
501 - _health_check.tags['CamelCase'] == 'CamelCaseValue'
502 - '"snake_case" in _health_check.tags'
503 - _health_check.tags['snake_case'] == 'snake_case_value'
504 - '"with space" in _health_check.tags'
505 - _health_check.tags['with space'] == 'Some value'
506 - _health_check.action is none
507 - '"health_check_config" in _health_check'
508 - '"type" in _check_config'
509 - '"disabled" in _check_config'
510 - '"failure_threshold" in _check_config'
511 - '"request_interval" in _check_config'
512 - '"fully_qualified_domain_name" not in _check_config'
513 - '"ip_address" in _check_config'
514 - '"port" in _check_config'
515 - '"resource_path" not in _check_config'
516 - '"search_string" not in _check_config'
517 - _check_config.disabled == true
518 - _check_config.type == 'TCP'
519 - _check_config.request_interval == 30
520 - _check_config.failure_threshold == failure_threshold_updated
521 - _check_config.ip_address == ip_address
522 - _check_config.port == check_port
523 vars:
524 _health_check: "{{ update_tags.health_check }}"
525 _check_config: "{{ _health_check.health_check_config }}"
526
527 - name: Update TCP health check - add tags - check_mode
528 amazon.aws.route53_health_check:
529 state: present
530 ip_address: "{{ ip_address }}"
531 port: "{{ check_port }}"
532 type: "{{ type }}"
533 tags:
534 anotherTag: anotherValue
535 purge_tags: false
536 register: add_tags
537 check_mode: true
538
539 - name: Check result - Update TCP health check - add tags - check_mode
540 ansible.builtin.assert:
541 that:
542 - add_tags is successful
543 - add_tags is changed
544
545 - name: Update TCP health check - add tags
546 amazon.aws.route53_health_check:
547 state: present
548 ip_address: "{{ ip_address }}"
549 port: "{{ check_port }}"
550 type: "{{ type }}"
551 tags:
552 anotherTag: anotherValue
553 purge_tags: false
554 register: add_tags
555
556 - name: Check result - Update TCP health check - add tags
557 ansible.builtin.assert:
558 that:
559 - add_tags is successful
560 - add_tags is changed
561 - '"health_check" in add_tags'
562 - '"id" in _health_check'
563 - _health_check.id == tcp_check_id
564 - '"action" in _health_check'
565 - '"health_check_version" in _health_check'
566 - '"tags" in _health_check'
567 - '"CamelCase" in _health_check.tags'
568 - _health_check.tags['CamelCase'] == 'CamelCaseValue'
569 - '"snake_case" in _health_check.tags'
570 - _health_check.tags['snake_case'] == 'snake_case_value'
571 - '"with space" in _health_check.tags'
572 - _health_check.tags['with space'] == 'Some value'
573 - '"anotherTag" in _health_check.tags'
574 - _health_check.tags['anotherTag'] == 'anotherValue'
575 - _health_check.action is none
576 - '"health_check_config" in _health_check'
577 - '"type" in _check_config'
578 - '"disabled" in _check_config'
579 - '"failure_threshold" in _check_config'
580 - '"request_interval" in _check_config'
581 - '"fully_qualified_domain_name" not in _check_config'
582 - '"ip_address" in _check_config'
583 - '"port" in _check_config'
584 - '"resource_path" not in _check_config'
585 - '"search_string" not in _check_config'
586 - _check_config.disabled == true
587 - _check_config.type == 'TCP'
588 - _check_config.request_interval == 30
589 - _check_config.failure_threshold == failure_threshold_updated
590 - _check_config.ip_address == ip_address
591 - _check_config.port == check_port
592 vars:
593 _health_check: "{{ add_tags.health_check }}"
594 _check_config: "{{ _health_check.health_check_config }}"
595
596 - name: Update TCP health check - add tags - idempotency - check_mode
597 amazon.aws.route53_health_check:
598 state: present
599 ip_address: "{{ ip_address }}"
600 port: "{{ check_port }}"
601 type: "{{ type }}"
602 tags:
603 anotherTag: anotherValue
604 purge_tags: false
605 register: add_tags
606 check_mode: true
607
608 - name: Check result - Update TCP health check - add tags - idempotency - check_mode
609 ansible.builtin.assert:
610 that:
611 - add_tags is successful
612 - add_tags is not changed
613
614 - name: Update TCP health check - add tags - idempotency
615 amazon.aws.route53_health_check:
616 state: present
617 ip_address: "{{ ip_address }}"
618 port: "{{ check_port }}"
619 type: "{{ type }}"
620 tags:
621 anotherTag: anotherValue
622 purge_tags: false
623 register: add_tags
624
625 - name: Check result - Update TCP health check - add tags - idempotency
626 ansible.builtin.assert:
627 that:
628 - add_tags is successful
629 - add_tags is not changed
630 - '"health_check" in add_tags'
631 - '"id" in _health_check'
632 - _health_check.id == tcp_check_id
633 - '"action" in _health_check'
634 - '"health_check_version" in _health_check'
635 - '"tags" in _health_check'
636 - '"CamelCase" in _health_check.tags'
637 - _health_check.tags['CamelCase'] == 'CamelCaseValue'
638 - '"snake_case" in _health_check.tags'
639 - _health_check.tags['snake_case'] == 'snake_case_value'
640 - '"with space" in _health_check.tags'
641 - _health_check.tags['with space'] == 'Some value'
642 - '"anotherTag" in _health_check.tags'
643 - _health_check.tags['anotherTag'] == 'anotherValue'
644 - _health_check.action is none
645 - '"health_check_config" in _health_check'
646 - '"type" in _check_config'
647 - '"disabled" in _check_config'
648 - '"failure_threshold" in _check_config'
649 - '"request_interval" in _check_config'
650 - '"fully_qualified_domain_name" not in _check_config'
651 - '"ip_address" in _check_config'
652 - '"port" in _check_config'
653 - '"resource_path" not in _check_config'
654 - '"search_string" not in _check_config'
655 - _check_config.disabled == true
656 - _check_config.type == 'TCP'
657 - _check_config.request_interval == 30
658 - _check_config.failure_threshold == failure_threshold_updated
659 - _check_config.ip_address == ip_address
660 - _check_config.port == check_port
661 vars:
662 _health_check: "{{ add_tags.health_check }}"
663 _check_config: "{{ _health_check.health_check_config }}"
664
665 - name: Update TCP health check - purge tags - check_mode
666 amazon.aws.route53_health_check:
667 state: present
668 ip_address: "{{ ip_address }}"
669 port: "{{ check_port }}"
670 type: "{{ type }}"
671 tags:
672 anotherTag: anotherValue
673 purge_tags: true
674 register: purge_tags
675 check_mode: true
676
677 - name: Check result - Update TCP health check - purge tags - check_mode
678 ansible.builtin.assert:
679 that:
680 - purge_tags is successful
681 - purge_tags is changed
682
683 - name: Update TCP health check - purge tags
684 amazon.aws.route53_health_check:
685 state: present
686 ip_address: "{{ ip_address }}"
687 port: "{{ check_port }}"
688 type: "{{ type }}"
689 tags:
690 anotherTag: anotherValue
691 purge_tags: true
692 register: purge_tags
693
694 - name: Check result - Update TCP health check - purge tags
695 ansible.builtin.assert:
696 that:
697 - purge_tags is successful
698 - purge_tags is changed
699 - '"health_check" in purge_tags'
700 - '"id" in _health_check'
701 - _health_check.id == tcp_check_id
702 - '"action" in _health_check'
703 - '"health_check_version" in _health_check'
704 - '"tags" in _health_check'
705 - '"CamelCase" not in _health_check.tags'
706 - '"snake_case" not in _health_check.tags'
707 - '"with space" not in _health_check.tags'
708 - '"anotherTag" in _health_check.tags'
709 - _health_check.tags['anotherTag'] == 'anotherValue'
710 - _health_check.action is none
711 - '"health_check_config" in _health_check'
712 - '"type" in _check_config'
713 - '"disabled" in _check_config'
714 - '"failure_threshold" in _check_config'
715 - '"request_interval" in _check_config'
716 - '"fully_qualified_domain_name" not in _check_config'
717 - '"ip_address" in _check_config'
718 - '"port" in _check_config'
719 - '"resource_path" not in _check_config'
720 - '"search_string" not in _check_config'
721 - _check_config.disabled == true
722 - _check_config.type == 'TCP'
723 - _check_config.request_interval == 30
724 - _check_config.failure_threshold == failure_threshold_updated
725 - _check_config.ip_address == ip_address
726 - _check_config.port == check_port
727 vars:
728 _health_check: "{{ purge_tags.health_check }}"
729 _check_config: "{{ _health_check.health_check_config }}"
730
731 - name: Update TCP health check - purge tags - idempotency - check_mode
732 amazon.aws.route53_health_check:
733 state: present
734 ip_address: "{{ ip_address }}"
735 port: "{{ check_port }}"
736 type: "{{ type }}"
737 tags:
738 anotherTag: anotherValue
739 purge_tags: true
740 register: purge_tags
741 check_mode: true
742
743 - name: Check result - Update TCP health check - purge tags - idempotency - check_mode
744 ansible.builtin.assert:
745 that:
746 - purge_tags is successful
747 - purge_tags is not changed
748
749 - name: Update TCP health check - purge tags - idempotency
750 amazon.aws.route53_health_check:
751 state: present
752 ip_address: "{{ ip_address }}"
753 port: "{{ check_port }}"
754 type: "{{ type }}"
755 tags:
756 anotherTag: anotherValue
757 purge_tags: true
758 register: purge_tags
759
760 - name: Check result - Update TCP health check - purge tags - idempotency
761 ansible.builtin.assert:
762 that:
763 - purge_tags is successful
764 - purge_tags is not changed
765 - '"health_check" in purge_tags'
766 - '"id" in _health_check'
767 - _health_check.id == tcp_check_id
768 - '"action" in _health_check'
769 - '"health_check_version" in _health_check'
770 - '"tags" in _health_check'
771 - '"CamelCase" not in _health_check.tags'
772 - '"snake_case" not in _health_check.tags'
773 - '"with space" not in _health_check.tags'
774 - '"anotherTag" in _health_check.tags'
775 - _health_check.tags['anotherTag'] == 'anotherValue'
776 - _health_check.action is none
777 - '"health_check_config" in _health_check'
778 - '"type" in _check_config'
779 - '"disabled" in _check_config'
780 - '"failure_threshold" in _check_config'
781 - '"request_interval" in _check_config'
782 - '"fully_qualified_domain_name" not in _check_config'
783 - '"ip_address" in _check_config'
784 - '"port" in _check_config'
785 - '"resource_path" not in _check_config'
786 - '"search_string" not in _check_config'
787 - _check_config.disabled == true
788 - _check_config.type == 'TCP'
789 - _check_config.request_interval == 30
790 - _check_config.failure_threshold == failure_threshold_updated
791 - _check_config.ip_address == ip_address
792 - _check_config.port == check_port
793 vars:
794 _health_check: "{{ purge_tags.health_check }}"
795 _check_config: "{{ _health_check.health_check_config }}"
796
797 # Delete the check
798 - name: Delete TCP health check - check_mode
799 amazon.aws.route53_health_check:
800 state: absent
801 ip_address: "{{ ip_address }}"
802 port: "{{ check_port }}"
803 type: "{{ type }}"
804 register: delete_tcp
805 check_mode: true
806
807 - name: Check result - Delete TCP health check - check_mode
808 ansible.builtin.assert:
809 that:
810 - delete_tcp is successful
811 - delete_tcp is changed
812
813 - name: Delete TCP health check
814 amazon.aws.route53_health_check:
815 state: absent
816 ip_address: "{{ ip_address }}"
817 port: "{{ check_port }}"
818 type: "{{ type }}"
819 register: delete_tcp
820
821 - name: Check result - Delete TCP health check
822 ansible.builtin.assert:
823 that:
824 - delete_tcp is successful
825 - delete_tcp is changed
826
827 - name: Delete TCP health check - idempotency - check_mode
828 amazon.aws.route53_health_check:
829 state: absent
830 ip_address: "{{ ip_address }}"
831 port: "{{ check_port }}"
832 type: "{{ type }}"
833 register: delete_tcp
834 check_mode: true
835
836 - name: Check result - Delete TCP health check - idempotency - check_mode
837 ansible.builtin.assert:
838 that:
839 - delete_tcp is successful
840 - delete_tcp is not changed
841
842 - name: Delete TCP health check - idempotency
843 amazon.aws.route53_health_check:
844 state: absent
845 ip_address: "{{ ip_address }}"
846 port: "{{ check_port }}"
847 type: "{{ type }}"
848 register: delete_tcp
849
850 - name: Check result - Delete TCP health check - idempotency
851 ansible.builtin.assert:
852 that:
853 - delete_tcp is successful
854 - delete_tcp is not changed
855
856 # Create an HTTPS_STR_MATCH healthcheck so we can try out more settings
857 - name: Create a HTTPS_STR_MATCH health check - check_mode
858 amazon.aws.route53_health_check:
859 state: present
860 ip_address: "{{ ip_address }}"
861 port: "{{ check_port }}"
862 type: "{{ type_https_match }}"
863 fqdn: "{{ fqdn }}"
864 request_interval: "{{ request_interval }}"
865 string_match: "{{ string_match }}"
866 register: create_match
867 check_mode: true
868
869 - name: Check result - Create a HTTPS_STR_MATCH health check - check_mode
870 ansible.builtin.assert:
871 that:
872 - create_match is successful
873 - create_match is changed
874
875 - name: Create a HTTPS_STR_MATCH health check
876 amazon.aws.route53_health_check:
877 state: present
878 ip_address: "{{ ip_address }}"
879 port: "{{ check_port }}"
880 type: "{{ type_https_match }}"
881 fqdn: "{{ fqdn }}"
882 request_interval: "{{ request_interval }}"
883 string_match: "{{ string_match }}"
884 register: create_match
885
886 - name: Check result - Create a HTTPS_STR_MATCH health check
887 ansible.builtin.assert:
888 that:
889 - create_match is successful
890 - create_match is changed
891 - '"health_check" in create_match'
892 - '"id" in _health_check'
893 - _health_check.id != tcp_check_id
894 - '"action" in _health_check'
895 - '"health_check_version" in _health_check'
896 - '"tags" in _health_check'
897 - _health_check.action == 'create'
898 - '"health_check_config" in _health_check'
899 - '"type" in _check_config'
900 - '"disabled" in _check_config'
901 - '"failure_threshold" in _check_config'
902 - '"request_interval" in _check_config'
903 - '"fully_qualified_domain_name" in _check_config'
904 - '"ip_address" in _check_config'
905 - '"port" in _check_config'
906 - '"resource_path" not in _check_config'
907 - '"search_string" in _check_config'
908 - _check_config.disabled == false
909 - _check_config.type == 'HTTPS_STR_MATCH'
910 - _check_config.request_interval == request_interval
911 - _check_config.failure_threshold == 3
912 - _check_config.fully_qualified_domain_name == fqdn
913 - _check_config.ip_address == ip_address
914 - _check_config.port == check_port
915 - _check_config.search_string == string_match
916 vars:
917 _health_check: "{{ create_match.health_check }}"
918 _check_config: "{{ _health_check.health_check_config }}"
919
920 - ansible.builtin.set_fact:
921 match_check_id: "{{ create_match.health_check.id }}"
922
923 - name: Create a HTTPS_STR_MATCH health check - idempotency - check_mode
924 amazon.aws.route53_health_check:
925 state: present
926 ip_address: "{{ ip_address }}"
927 port: "{{ check_port }}"
928 type: "{{ type_https_match }}"
929 fqdn: "{{ fqdn }}"
930 request_interval: "{{ request_interval }}"
931 string_match: "{{ string_match }}"
932 register: create_match
933 check_mode: true
934
935 - name: Check result - Create a HTTPS_STR_MATCH health check - idempotency - check_mode
936 ansible.builtin.assert:
937 that:
938 - create_match is successful
939 - create_match is not changed
940
941 - name: Create a HTTPS_STR_MATCH health check - idempotency
942 amazon.aws.route53_health_check:
943 state: present
944 ip_address: "{{ ip_address }}"
945 port: "{{ check_port }}"
946 type: "{{ type_https_match }}"
947 fqdn: "{{ fqdn }}"
948 request_interval: "{{ request_interval }}"
949 string_match: "{{ string_match }}"
950 register: create_match
951
952 - name: Check result - Create a HTTPS_STR_MATCH health check - idempotency
953 ansible.builtin.assert:
954 that:
955 - create_match is successful
956 - create_match is not changed
957 - '"health_check" in create_match'
958 - '"id" in _health_check'
959 - _health_check.id == match_check_id
960 - '"action" in _health_check'
961 - '"health_check_version" in _health_check'
962 - '"tags" in _health_check'
963 - _health_check.action is none
964 - '"health_check_config" in _health_check'
965 - '"type" in _check_config'
966 - '"disabled" in _check_config'
967 - '"failure_threshold" in _check_config'
968 - '"request_interval" in _check_config'
969 - '"fully_qualified_domain_name" in _check_config'
970 - '"ip_address" in _check_config'
971 - '"port" in _check_config'
972 - '"resource_path" not in _check_config'
973 - '"search_string" in _check_config'
974 - _check_config.disabled == false
975 - _check_config.type == type_https_match
976 - _check_config.request_interval == request_interval
977 - _check_config.failure_threshold == 3
978 - _check_config.fully_qualified_domain_name == fqdn
979 - _check_config.ip_address == ip_address
980 - _check_config.port == check_port
981 - _check_config.search_string == string_match
982 vars:
983 _health_check: "{{ create_match.health_check }}"
984 _check_config: "{{ _health_check.health_check_config }}"
985
986 - name: Update HTTPS health check - set resource_path - check_mode
987 amazon.aws.route53_health_check:
988 state: present
989 ip_address: "{{ ip_address }}"
990 port: "{{ check_port }}"
991 type: "{{ type_https_match }}"
992 fqdn: "{{ fqdn }}"
993 request_interval: "{{ request_interval }}"
994 resource_path: "{{ resource_path }}"
995 register: update_resource_path
996 check_mode: true
997
998 - name: Check result - Update HTTPS health check - set resource_path - check_mode
999 ansible.builtin.assert:
1000 that:
1001 - update_resource_path is successful
1002 - update_resource_path is changed
1003
1004 - name: Update HTTPS health check - set resource_path
1005 amazon.aws.route53_health_check:
1006 state: present
1007 ip_address: "{{ ip_address }}"
1008 port: "{{ check_port }}"
1009 type: "{{ type_https_match }}"
1010 fqdn: "{{ fqdn }}"
1011 request_interval: "{{ request_interval }}"
1012 resource_path: "{{ resource_path }}"
1013 register: update_resource_path
1014
1015 - name: Check result - Update HTTPS health check - set resource_path
1016 ansible.builtin.assert:
1017 that:
1018 - update_resource_path is successful
1019 - update_resource_path is changed
1020 - '"health_check" in update_resource_path'
1021 - '"id" in _health_check'
1022 - _health_check.id == match_check_id
1023 - '"action" in _health_check'
1024 - '"health_check_version" in _health_check'
1025 - '"tags" in _health_check'
1026 - _health_check.action == 'update'
1027 - '"health_check_config" in _health_check'
1028 - '"type" in _check_config'
1029 - '"disabled" in _check_config'
1030 - '"failure_threshold" in _check_config'
1031 - '"request_interval" in _check_config'
1032 - '"fully_qualified_domain_name" in _check_config'
1033 - '"ip_address" in _check_config'
1034 - '"port" in _check_config'
1035 - '"resource_path" in _check_config'
1036 - '"search_string" in _check_config'
1037 - _check_config.disabled == false
1038 - _check_config.type == type_https_match
1039 - _check_config.request_interval == request_interval
1040 - _check_config.failure_threshold == 3
1041 - _check_config.fully_qualified_domain_name == fqdn
1042 - _check_config.ip_address == ip_address
1043 - _check_config.port == check_port
1044 - _check_config.resource_path == resource_path
1045 - _check_config.search_string == string_match
1046 vars:
1047 _health_check: "{{ update_resource_path.health_check }}"
1048 _check_config: "{{ _health_check.health_check_config }}"
1049
1050 - name: Update HTTPS health check - set resource_path - idempotency - check_mode
1051 amazon.aws.route53_health_check:
1052 state: present
1053 ip_address: "{{ ip_address }}"
1054 port: "{{ check_port }}"
1055 type: "{{ type_https_match }}"
1056 fqdn: "{{ fqdn }}"
1057 request_interval: "{{ request_interval }}"
1058 resource_path: "{{ resource_path }}"
1059 register: update_resource_path
1060 check_mode: true
1061
1062 - name: Check result - Update HTTPS health check - set resource_path - idempotency - check_mode
1063 ansible.builtin.assert:
1064 that:
1065 - update_resource_path is successful
1066 - update_resource_path is not changed
1067
1068 - name: Update HTTPS health check - set resource_path - idempotency
1069 amazon.aws.route53_health_check:
1070 state: present
1071 ip_address: "{{ ip_address }}"
1072 port: "{{ check_port }}"
1073 type: "{{ type_https_match }}"
1074 fqdn: "{{ fqdn }}"
1075 request_interval: "{{ request_interval }}"
1076 resource_path: "{{ resource_path }}"
1077 register: update_resource_path
1078
1079 - name: Check result - Update HTTPS health check - set resource_path - idempotency
1080 ansible.builtin.assert:
1081 that:
1082 - update_resource_path is successful
1083 - update_resource_path is not changed
1084 - '"health_check" in update_resource_path'
1085 - '"id" in _health_check'
1086 - _health_check.id == match_check_id
1087 - '"action" in _health_check'
1088 - '"health_check_version" in _health_check'
1089 - '"tags" in _health_check'
1090 - _health_check.action is none
1091 - '"health_check_config" in _health_check'
1092 - '"type" in _check_config'
1093 - '"disabled" in _check_config'
1094 - '"failure_threshold" in _check_config'
1095 - '"request_interval" in _check_config'
1096 - '"fully_qualified_domain_name" in _check_config'
1097 - '"ip_address" in _check_config'
1098 - '"port" in _check_config'
1099 - '"resource_path" in _check_config'
1100 - '"search_string" in _check_config'
1101 - _check_config.disabled == false
1102 - _check_config.type == type_https_match
1103 - _check_config.request_interval == request_interval
1104 - _check_config.failure_threshold == 3
1105 - _check_config.fully_qualified_domain_name == fqdn
1106 - _check_config.ip_address == ip_address
1107 - _check_config.port == check_port
1108 - _check_config.resource_path == resource_path
1109 - _check_config.search_string == string_match
1110 vars:
1111 _health_check: "{{ update_resource_path.health_check }}"
1112 _check_config: "{{ _health_check.health_check_config }}"
1113
1114 - name: Update HTTPS health check - set string_match - check_mode
1115 amazon.aws.route53_health_check:
1116 state: present
1117 ip_address: "{{ ip_address }}"
1118 port: "{{ check_port }}"
1119 type: "{{ type_https_match }}"
1120 fqdn: "{{ fqdn }}"
1121 request_interval: "{{ request_interval }}"
1122 string_match: "{{ string_match_updated }}"
1123 register: update_string_match
1124 check_mode: true
1125
1126 - name: Check result - Update HTTPS health check - set string_match - check_mode
1127 ansible.builtin.assert:
1128 that:
1129 - update_string_match is successful
1130 - update_string_match is changed
1131
1132 - name: Update HTTPS health check - set string_match
1133 amazon.aws.route53_health_check:
1134 state: present
1135 ip_address: "{{ ip_address }}"
1136 port: "{{ check_port }}"
1137 type: "{{ type_https_match }}"
1138 fqdn: "{{ fqdn }}"
1139 request_interval: "{{ request_interval }}"
1140 string_match: "{{ string_match_updated }}"
1141 register: update_string_match
1142
1143 - name: Check result - Update HTTPS health check - set string_match
1144 ansible.builtin.assert:
1145 that:
1146 - update_string_match is successful
1147 - update_string_match is changed
1148 - '"health_check" in update_string_match'
1149 - '"id" in _health_check'
1150 - _health_check.id == match_check_id
1151 - '"action" in _health_check'
1152 - '"health_check_version" in _health_check'
1153 - '"tags" in _health_check'
1154 - _health_check.action == 'update'
1155 - '"health_check_config" in _health_check'
1156 - '"type" in _check_config'
1157 - '"disabled" in _check_config'
1158 - '"failure_threshold" in _check_config'
1159 - '"request_interval" in _check_config'
1160 - '"fully_qualified_domain_name" in _check_config'
1161 - '"ip_address" in _check_config'
1162 - '"port" in _check_config'
1163 - '"resource_path" in _check_config'
1164 - '"search_string" in _check_config'
1165 - _check_config.disabled == false
1166 - _check_config.type == type_https_match
1167 - _check_config.request_interval == request_interval
1168 - _check_config.failure_threshold == 3
1169 - _check_config.fully_qualified_domain_name == fqdn
1170 - _check_config.ip_address == ip_address
1171 - _check_config.port == check_port
1172 - _check_config.resource_path == resource_path
1173 - _check_config.search_string == string_match_updated
1174 vars:
1175 _health_check: "{{ update_string_match.health_check }}"
1176 _check_config: "{{ _health_check.health_check_config }}"
1177
1178 - name: Update HTTPS health check - set string_match - idempotency - check_mode
1179 amazon.aws.route53_health_check:
1180 state: present
1181 ip_address: "{{ ip_address }}"
1182 port: "{{ check_port }}"
1183 type: "{{ type_https_match }}"
1184 fqdn: "{{ fqdn }}"
1185 request_interval: "{{ request_interval }}"
1186 string_match: "{{ string_match_updated }}"
1187 register: update_string_match
1188 check_mode: true
1189
1190 - name: Check result - Update HTTPS health check - set string_match - idempotency - check_mode
1191 ansible.builtin.assert:
1192 that:
1193 - update_string_match is successful
1194 - update_string_match is not changed
1195
1196 - name: Update HTTPS health check - set string_match - idempotency
1197 amazon.aws.route53_health_check:
1198 state: present
1199 ip_address: "{{ ip_address }}"
1200 port: "{{ check_port }}"
1201 type: "{{ type_https_match }}"
1202 fqdn: "{{ fqdn }}"
1203 request_interval: "{{ request_interval }}"
1204 string_match: "{{ string_match_updated }}"
1205 register: update_string_match
1206
1207 - name: Check result - Update HTTPS health check - set string_match - idempotency
1208 ansible.builtin.assert:
1209 that:
1210 - update_string_match is successful
1211 - update_string_match is not changed
1212 - '"health_check" in update_string_match'
1213 - '"id" in _health_check'
1214 - _health_check.id == match_check_id
1215 - '"action" in _health_check'
1216 - '"health_check_version" in _health_check'
1217 - '"tags" in _health_check'
1218 - _health_check.action is none
1219 - '"health_check_config" in _health_check'
1220 - '"type" in _check_config'
1221 - '"disabled" in _check_config'
1222 - '"failure_threshold" in _check_config'
1223 - '"request_interval" in _check_config'
1224 - '"fully_qualified_domain_name" in _check_config'
1225 - '"ip_address" in _check_config'
1226 - '"port" in _check_config'
1227 - '"resource_path" in _check_config'
1228 - '"search_string" in _check_config'
1229 - _check_config.disabled == false
1230 - _check_config.type == type_https_match
1231 - _check_config.request_interval == request_interval
1232 - _check_config.failure_threshold == 3
1233 - _check_config.fully_qualified_domain_name == fqdn
1234 - _check_config.ip_address == ip_address
1235 - _check_config.port == check_port
1236 - _check_config.resource_path == resource_path
1237 - _check_config.search_string == string_match_updated
1238 vars:
1239 _health_check: "{{ update_string_match.health_check }}"
1240 _check_config: "{{ _health_check.health_check_config }}"
1241
1242 # Test deletion
1243 - name: Delete HTTPS health check - check_mode
1244 amazon.aws.route53_health_check:
1245 state: absent
1246 ip_address: "{{ ip_address }}"
1247 port: "{{ check_port }}"
1248 type: "{{ type_https_match }}"
1249 fqdn: "{{ fqdn }}"
1250 request_interval: "{{ request_interval }}"
1251 register: delete_match
1252 check_mode: true
1253
1254 - name: Check result - Delete HTTPS health check - check_mode
1255 ansible.builtin.assert:
1256 that:
1257 - delete_match is successful
1258 - delete_match is changed
1259
1260 - name: Delete HTTPS health check
1261 amazon.aws.route53_health_check:
1262 state: absent
1263 ip_address: "{{ ip_address }}"
1264 port: "{{ check_port }}"
1265 type: "{{ type_https_match }}"
1266 fqdn: "{{ fqdn }}"
1267 request_interval: "{{ request_interval }}"
1268 register: delete_match
1269
1270 - name: Check result - Delete HTTPS health check
1271 ansible.builtin.assert:
1272 that:
1273 - delete_match is successful
1274 - delete_match is changed
1275
1276 - name: Delete HTTPS health check - idempotency - check_mode
1277 amazon.aws.route53_health_check:
1278 state: absent
1279 ip_address: "{{ ip_address }}"
1280 port: "{{ check_port }}"
1281 type: "{{ type_https_match }}"
1282 fqdn: "{{ fqdn }}"
1283 request_interval: "{{ request_interval }}"
1284 register: delete_match
1285 check_mode: true
1286
1287 - name: Check result - Delete HTTPS health check - idempotency - check_mode
1288 ansible.builtin.assert:
1289 that:
1290 - delete_match is successful
1291 - delete_match is not changed
1292
1293 - name: Delete HTTPS health check - idempotency
1294 amazon.aws.route53_health_check:
1295 state: absent
1296 ip_address: "{{ ip_address }}"
1297 port: "{{ check_port }}"
1298 type: "{{ type_https_match }}"
1299 fqdn: "{{ fqdn }}"
1300 request_interval: "{{ request_interval }}"
1301 register: delete_match
1302
1303 - name: Check result - Delete HTTPS health check - idempotency
1304 ansible.builtin.assert:
1305 that:
1306 - delete_match is successful
1307 - delete_match is not changed
1308
1309 # Create an HTTP health check with lots of settings we can update
1310 - name: Create Complex health check - check_mode
1311 amazon.aws.route53_health_check:
1312 state: present
1313 ip_address: "{{ ip_address }}"
1314 port: "{{ check_port }}"
1315 type: "{{ type_http_match }}"
1316 fqdn: "{{ fqdn }}"
1317 request_interval: "{{ request_interval }}"
1318 string_match: "{{ string_match }}"
1319 resource_path: "{{ resource_path }}"
1320 failure_threshold: "{{ failure_threshold }}"
1321 disabled: true
1322 tags:
1323 CamelCase: CamelCaseValue
1324 snake_case: snake_case_value
1325 with space: Some value
1326 purge_tags: false
1327 register: create_complex
1328 check_mode: true
1329
1330 - name: Check result - Create Complex health check - check_mode
1331 ansible.builtin.assert:
1332 that:
1333 - create_complex is successful
1334 - create_complex is changed
1335
1336 - name: Create Complex health check
1337 amazon.aws.route53_health_check:
1338 state: present
1339 ip_address: "{{ ip_address }}"
1340 port: "{{ check_port }}"
1341 type: "{{ type_http_match }}"
1342 fqdn: "{{ fqdn }}"
1343 request_interval: "{{ request_interval }}"
1344 string_match: "{{ string_match }}"
1345 resource_path: "{{ resource_path }}"
1346 failure_threshold: "{{ failure_threshold }}"
1347 disabled: true
1348 tags:
1349 CamelCase: CamelCaseValue
1350 snake_case: snake_case_value
1351 with space: Some value
1352 purge_tags: false
1353 register: create_complex
1354
1355 - name: Check result - Create Complex health check
1356 ansible.builtin.assert:
1357 that:
1358 - create_complex is successful
1359 - create_complex is changed
1360 - '"health_check" in create_complex'
1361 - '"id" in _health_check'
1362 - _health_check.id != tcp_check_id
1363 - _health_check.id != match_check_id
1364 - '"action" in _health_check'
1365 - '"health_check_version" in _health_check'
1366 - '"tags" in _health_check'
1367 - '"CamelCase" in _health_check.tags'
1368 - _health_check.tags['CamelCase'] == 'CamelCaseValue'
1369 - '"snake_case" in _health_check.tags'
1370 - _health_check.tags['snake_case'] == 'snake_case_value'
1371 - '"with space" in _health_check.tags'
1372 - _health_check.tags['with space'] == 'Some value'
1373 - _health_check.action == 'create'
1374 - '"health_check_config" in _health_check'
1375 - '"type" in _check_config'
1376 - '"disabled" in _check_config'
1377 - '"failure_threshold" in _check_config'
1378 - '"request_interval" in _check_config'
1379 - '"fully_qualified_domain_name" in _check_config'
1380 - '"ip_address" in _check_config'
1381 - '"port" in _check_config'
1382 - '"resource_path" in _check_config'
1383 - '"search_string" in _check_config'
1384 - _check_config.disabled == true
1385 - _check_config.type == type_http_match
1386 - _check_config.request_interval == request_interval
1387 - _check_config.failure_threshold == failure_threshold
1388 - _check_config.fully_qualified_domain_name == fqdn
1389 - _check_config.ip_address == ip_address
1390 - _check_config.port == check_port
1391 - _check_config.resource_path == resource_path
1392 - _check_config.search_string == string_match
1393 vars:
1394 _health_check: "{{ create_complex.health_check }}"
1395 _check_config: "{{ _health_check.health_check_config }}"
1396
1397 - ansible.builtin.set_fact:
1398 complex_check_id: "{{ create_complex.health_check.id }}"
1399
1400 - name: Create Complex health check - idempotency - check_mode
1401 amazon.aws.route53_health_check:
1402 state: present
1403 ip_address: "{{ ip_address }}"
1404 port: "{{ check_port }}"
1405 type: "{{ type_http_match }}"
1406 fqdn: "{{ fqdn }}"
1407 request_interval: "{{ request_interval }}"
1408 string_match: "{{ string_match }}"
1409 resource_path: "{{ resource_path }}"
1410 failure_threshold: "{{ failure_threshold }}"
1411 disabled: true
1412 tags:
1413 CamelCase: CamelCaseValue
1414 snake_case: snake_case_value
1415 with space: Some value
1416 purge_tags: false
1417 register: create_complex
1418 check_mode: true
1419
1420 - name: Check result - Create Complex health check - idempotency - check_mode
1421 ansible.builtin.assert:
1422 that:
1423 - create_complex is successful
1424 - create_complex is not changed
1425
1426 - name: Create Complex health check - idempotency
1427 amazon.aws.route53_health_check:
1428 state: present
1429 ip_address: "{{ ip_address }}"
1430 port: "{{ check_port }}"
1431 type: "{{ type_http_match }}"
1432 fqdn: "{{ fqdn }}"
1433 request_interval: "{{ request_interval }}"
1434 string_match: "{{ string_match }}"
1435 resource_path: "{{ resource_path }}"
1436 failure_threshold: "{{ failure_threshold }}"
1437 disabled: true
1438 tags:
1439 CamelCase: CamelCaseValue
1440 snake_case: snake_case_value
1441 with space: Some value
1442 purge_tags: false
1443 register: create_complex
1444
1445 - name: Check result - Create Complex health check - idempotency
1446 ansible.builtin.assert:
1447 that:
1448 - create_complex is successful
1449 - create_complex is not changed
1450 - '"health_check" in create_complex'
1451 - '"id" in _health_check'
1452 - _health_check.id == complex_check_id
1453 - '"action" in _health_check'
1454 - '"health_check_version" in _health_check'
1455 - '"tags" in _health_check'
1456 - '"CamelCase" in _health_check.tags'
1457 - _health_check.tags['CamelCase'] == 'CamelCaseValue'
1458 - '"snake_case" in _health_check.tags'
1459 - _health_check.tags['snake_case'] == 'snake_case_value'
1460 - '"with space" in _health_check.tags'
1461 - _health_check.tags['with space'] == 'Some value'
1462 - _health_check.action is none
1463 - '"health_check_config" in _health_check'
1464 - '"type" in _check_config'
1465 - '"disabled" in _check_config'
1466 - '"failure_threshold" in _check_config'
1467 - '"request_interval" in _check_config'
1468 - '"fully_qualified_domain_name" in _check_config'
1469 - '"ip_address" in _check_config'
1470 - '"port" in _check_config'
1471 - '"resource_path" in _check_config'
1472 - '"search_string" in _check_config'
1473 - _check_config.disabled == true
1474 - _check_config.type == type_http_match
1475 - _check_config.request_interval == request_interval
1476 - _check_config.failure_threshold == failure_threshold
1477 - _check_config.fully_qualified_domain_name == fqdn
1478 - _check_config.ip_address == ip_address
1479 - _check_config.port == check_port
1480 - _check_config.resource_path == resource_path
1481 - _check_config.search_string == string_match
1482 vars:
1483 _health_check: "{{ create_complex.health_check }}"
1484 _check_config: "{{ _health_check.health_check_config }}"
1485
1486 - name: Update Complex health check - check_mode
1487 amazon.aws.route53_health_check:
1488 state: present
1489 ip_address: "{{ ip_address }}"
1490 port: "{{ check_port }}"
1491 type: "{{ type_http_match }}"
1492 fqdn: "{{ fqdn }}"
1493 request_interval: "{{ request_interval }}"
1494 string_match: "{{ string_match_updated }}"
1495 resource_path: "{{ resource_path_updated }}"
1496 failure_threshold: "{{ failure_threshold_updated }}"
1497 register: update_complex
1498 check_mode: true
1499
1500 - name: Check result - Update Complex health check - check_mode
1501 ansible.builtin.assert:
1502 that:
1503 - update_complex is successful
1504 - update_complex is changed
1505
1506 - name: Update Complex health check
1507 amazon.aws.route53_health_check:
1508 state: present
1509 ip_address: "{{ ip_address }}"
1510 port: "{{ check_port }}"
1511 type: "{{ type_http_match }}"
1512 fqdn: "{{ fqdn }}"
1513 request_interval: "{{ request_interval }}"
1514 string_match: "{{ string_match_updated }}"
1515 resource_path: "{{ resource_path_updated }}"
1516 failure_threshold: "{{ failure_threshold_updated }}"
1517 register: update_complex
1518
1519 - name: Check result - Update Complex health check
1520 ansible.builtin.assert:
1521 that:
1522 - update_complex is successful
1523 - update_complex is changed
1524 - '"health_check" in update_complex'
1525 - '"id" in _health_check'
1526 - _health_check.id == complex_check_id
1527 - '"action" in _health_check'
1528 - '"health_check_version" in _health_check'
1529 - '"tags" in _health_check'
1530 - '"CamelCase" in _health_check.tags'
1531 - _health_check.tags['CamelCase'] == 'CamelCaseValue'
1532 - '"snake_case" in _health_check.tags'
1533 - _health_check.tags['snake_case'] == 'snake_case_value'
1534 - '"with space" in _health_check.tags'
1535 - _health_check.tags['with space'] == 'Some value'
1536 - _health_check.action == 'update'
1537 - '"health_check_config" in _health_check'
1538 - '"type" in _check_config'
1539 - '"disabled" in _check_config'
1540 - '"failure_threshold" in _check_config'
1541 - '"request_interval" in _check_config'
1542 - '"fully_qualified_domain_name" in _check_config'
1543 - '"ip_address" in _check_config'
1544 - '"port" in _check_config'
1545 - '"resource_path" in _check_config'
1546 - '"search_string" in _check_config'
1547 - _check_config.disabled == true
1548 - _check_config.type == type_http_match
1549 - _check_config.request_interval == request_interval
1550 - _check_config.failure_threshold == failure_threshold_updated
1551 - _check_config.fully_qualified_domain_name == fqdn
1552 - _check_config.ip_address == ip_address
1553 - _check_config.port == check_port
1554 - _check_config.resource_path == resource_path_updated
1555 - _check_config.search_string == string_match_updated
1556 vars:
1557 _health_check: "{{ update_complex.health_check }}"
1558 _check_config: "{{ _health_check.health_check_config }}"
1559
1560 - name: Update Complex health check - idempotency - check_mode
1561 amazon.aws.route53_health_check:
1562 state: present
1563 ip_address: "{{ ip_address }}"
1564 port: "{{ check_port }}"
1565 type: "{{ type_http_match }}"
1566 fqdn: "{{ fqdn }}"
1567 request_interval: "{{ request_interval }}"
1568 string_match: "{{ string_match_updated }}"
1569 resource_path: "{{ resource_path_updated }}"
1570 failure_threshold: "{{ failure_threshold_updated }}"
1571 register: update_complex
1572 check_mode: true
1573
1574 - name: Check result - Update Complex health check - idempotency - check_mode
1575 ansible.builtin.assert:
1576 that:
1577 - update_complex is successful
1578 - update_complex is not changed
1579
1580 - name: Update Complex health check - idempotency
1581 amazon.aws.route53_health_check:
1582 state: present
1583 ip_address: "{{ ip_address }}"
1584 port: "{{ check_port }}"
1585 type: "{{ type_http_match }}"
1586 fqdn: "{{ fqdn }}"
1587 request_interval: "{{ request_interval }}"
1588 string_match: "{{ string_match_updated }}"
1589 resource_path: "{{ resource_path_updated }}"
1590 failure_threshold: "{{ failure_threshold_updated }}"
1591 register: update_complex
1592
1593 - name: Check result - Update Complex health check - idempotency
1594 ansible.builtin.assert:
1595 that:
1596 - update_complex is successful
1597 - update_complex is not changed
1598 - '"health_check" in update_complex'
1599 - '"id" in _health_check'
1600 - _health_check.id == complex_check_id
1601 - '"action" in _health_check'
1602 - '"health_check_version" in _health_check'
1603 - '"tags" in _health_check'
1604 - '"CamelCase" in _health_check.tags'
1605 - _health_check.tags['CamelCase'] == 'CamelCaseValue'
1606 - '"snake_case" in _health_check.tags'
1607 - _health_check.tags['snake_case'] == 'snake_case_value'
1608 - '"with space" in _health_check.tags'
1609 - _health_check.tags['with space'] == 'Some value'
1610 - _health_check.action is none
1611 - '"health_check_config" in _health_check'
1612 - '"type" in _check_config'
1613 - '"disabled" in _check_config'
1614 - '"failure_threshold" in _check_config'
1615 - '"request_interval" in _check_config'
1616 - '"fully_qualified_domain_name" in _check_config'
1617 - '"ip_address" in _check_config'
1618 - '"port" in _check_config'
1619 - '"resource_path" in _check_config'
1620 - '"search_string" in _check_config'
1621 - _check_config.disabled == true
1622 - _check_config.type == type_http_match
1623 - _check_config.request_interval == request_interval
1624 - _check_config.failure_threshold == failure_threshold_updated
1625 - _check_config.fully_qualified_domain_name == fqdn
1626 - _check_config.ip_address == ip_address
1627 - _check_config.port == check_port
1628 - _check_config.resource_path == resource_path_updated
1629 - _check_config.search_string == string_match_updated
1630 vars:
1631 _health_check: "{{ update_complex.health_check }}"
1632 _check_config: "{{ _health_check.health_check_config }}"
1633
1634 - name: Delete Complex health check - check_mode
1635 amazon.aws.route53_health_check:
1636 state: absent
1637 ip_address: "{{ ip_address }}"
1638 port: "{{ check_port }}"
1639 type: "{{ type_http_match }}"
1640 fqdn: "{{ fqdn }}"
1641 request_interval: "{{ request_interval }}"
1642 register: delete_complex
1643 check_mode: true
1644
1645 - name: Check result - Delete Complex health check - check_mode
1646 ansible.builtin.assert:
1647 that:
1648 - delete_complex is successful
1649 - delete_complex is changed
1650
1651 - name: Delete Complex health check
1652 amazon.aws.route53_health_check:
1653 state: absent
1654 ip_address: "{{ ip_address }}"
1655 port: "{{ check_port }}"
1656 type: "{{ type_http_match }}"
1657 fqdn: "{{ fqdn }}"
1658 request_interval: "{{ request_interval }}"
1659 register: delete_complex
1660
1661 - name: Check result - Delete Complex health check
1662 ansible.builtin.assert:
1663 that:
1664 - delete_complex is successful
1665 - delete_complex is changed
1666
1667 - name: Delete Complex health check - idempotency - check_mode
1668 amazon.aws.route53_health_check:
1669 state: absent
1670 ip_address: "{{ ip_address }}"
1671 port: "{{ check_port }}"
1672 type: "{{ type_http_match }}"
1673 fqdn: "{{ fqdn }}"
1674 request_interval: "{{ request_interval }}"
1675 register: delete_complex
1676 check_mode: true
1677
1678 - name: Check result - Delete Complex health check - idempotency - check_mode
1679 ansible.builtin.assert:
1680 that:
1681 - delete_complex is successful
1682 - delete_complex is not changed
1683
1684 - name: Delete Complex health check - idempotency
1685 amazon.aws.route53_health_check:
1686 state: absent
1687 ip_address: "{{ ip_address }}"
1688 port: "{{ check_port }}"
1689 type: "{{ type_http_match }}"
1690 fqdn: "{{ fqdn }}"
1691 request_interval: "{{ request_interval }}"
1692 register: delete_complex
1693
1694 - name: Check result - Delete Complex health check - idempotency
1695 ansible.builtin.assert:
1696 that:
1697 - delete_complex is successful
1698 - delete_complex is not changed
1699
1700 # Minimum possible definition
1701 - name: Create a TCP health check with latency graphs enabled
1702 amazon.aws.route53_health_check:
1703 state: present
1704 health_check_name: "{{ tiny_prefix }}-hc-latency-graph"
1705 use_unique_names: true
1706 ip_address: "{{ ip_address }}"
1707 port: "{{ check_port }}"
1708 type: "{{ type }}"
1709 measure_latency: true
1710 register: create_check
1711
1712 - name: Get health check info
1713 amazon.aws.route53_info:
1714 query: health_check
1715 health_check_id: "{{ create_check.health_check.id }}"
1716 health_check_method: details
1717 register: health_check_info
1718
1719 - name: Check result - Create a TCP health check with latency graphs enabled
1720 ansible.builtin.assert:
1721 that:
1722 - create_check is successful
1723 - create_check is changed
1724 - health_check_info.health_check.health_check_config.measure_latency == true
1725
1726 - ansible.builtin.pause:
1727 seconds: 20
1728
1729 # test route53_info for health_check_method=status
1730 - name: Get health check status
1731 amazon.aws.route53_info:
1732 query: health_check
1733 health_check_id: "{{ create_check.health_check.id }}"
1734 health_check_method: status
1735 register: health_check_status_info
1736
1737 - ansible.builtin.assert:
1738 that:
1739 - health_check_status_info is not failed
1740 - '"health_check_observations" in health_check_status_info'
1741
1742 # test route53_info for health_check_method=failure_reason
1743 - name: Get health check failure_reason
1744 amazon.aws.route53_info:
1745 query: health_check
1746 health_check_id: "{{ create_check.health_check.id }}"
1747 health_check_method: failure_reason
1748 register: health_check_failure_reason_info
1749
1750 - ansible.builtin.assert:
1751 that:
1752 - health_check_failure_reason_info is not failed
1753 - '"health_check_observations" in health_check_failure_reason_info'
1754
1755 - name: Update above health check to disable latency graphs - immutable, no change
1756 amazon.aws.route53_health_check:
1757 state: present
1758 health_check_name: "{{ tiny_prefix }}-hc-latency-graph"
1759 use_unique_names: true
1760 ip_address: "{{ ip_address }}"
1761 port: "{{ check_port }}"
1762 type: "{{ type }}"
1763 measure_latency: false
1764 register: update_check
1765
1766 - name: Check result - Update TCP health check to disable latency graphs
1767 ansible.builtin.assert:
1768 that:
1769 - update_check is successful
1770 - update_check is not changed
1771 - health_check_info.health_check.health_check_config.measure_latency == true
1772
1773 always:
1774 ################################################
1775 # TEARDOWN STARTS HERE
1776 ################################################
1777
1778 - name: Delete TCP health check with latency graphs enabled
1779 amazon.aws.route53_health_check:
1780 state: absent
1781 health_check_name: "{{ tiny_prefix }}-hc-latency-graph"
1782 use_unique_names: true
1783 ip_address: "{{ ip_address }}"
1784 port: "{{ check_port }}"
1785 type: "{{ type }}"
1786 measure_latency: true
1787 ignore_errors: true
1788
1789 - name: Delete TCP health check
1790 amazon.aws.route53_health_check:
1791 state: absent
1792 ip_address: "{{ ip_address }}"
1793 port: "{{ check_port }}"
1794 type: "{{ type }}"
1795 ignore_errors: true
1796
1797 - name: Delete HTTPS health check
1798 amazon.aws.route53_health_check:
1799 state: absent
1800 ip_address: "{{ ip_address }}"
1801 port: "{{ check_port }}"
1802 type: "{{ type_https_match }}"
1803 fqdn: "{{ fqdn }}"
1804 request_interval: "{{ request_interval }}"
1805 ignore_errors: true
1806
1807 - name: Delete Complex health check
1808 amazon.aws.route53_health_check:
1809 state: absent
1810 ip_address: "{{ ip_address }}"
1811 port: "{{ check_port }}"
1812 type: "{{ type_http_match }}"
1813 fqdn: "{{ fqdn }}"
1814 request_interval: "{{ request_interval }}"
1815 ignore_errors: true
1816
1817 - name: Release EIP
1818 amazon.aws.ec2_eip:
1819 state: absent
1820 public_ip: "{{ ip_address }}"
1821 ignore_errors: true