Debian Codegraph @

ansible_collections/community/aws/tests/integration/targets/ses_rule_set/tasks/main.yaml

raw
1 ---
2 - name: 'aws_ses_rule_set integration tests'
3 collections:
4 - amazon.aws
5 module_defaults:
6 group/aws:
7 access_key: '{{ aws_access_key }}'
8 secret_key: '{{ aws_secret_key }}'
9 session_token: '{{ security_token | default(omit) }}'
10 region: '{{ aws_region }}'
11 block:
12
13 - include_tasks: inactive-rule-set-tests.yaml
14
15 # ============================================================
16 # There can only be a single active rule set, tests that
17 # relies on the active state of the rule cannot be run in
18 # parallel.
19 # To prevent failures due to parallel runs in the integration
20 # builds, the below block creates a lock to ensure that only
21 # one process will be running these tests in the same region
22 # and same AWS account.
23 # See obtain-lock.yaml for explanation of how the lock is
24 # constructed.
25 # ============================================================
26 - name: Active Rule Set Tests
27 block:
28 - name: Obtain Lock
29 include_tasks: obtain-lock-wrapper.yaml
30 # Use of loop here is a workaround for lack of support for
31 # do-until loops on includes. See:
32 # https://github.com/ansible/ansible/issues/17098
33 loop: "{{ range(0, max_obtain_lock_attempts, 1)|list }}"
34 loop_control:
35 loop_var: obtain_lock_attempt
36
37 # Because of the above workaround we have to explicitly check
38 # that the lock was obtained
39 - name: Check Obtained Lock
40 assert:
41 msg: "Could not obtain lock after {{ max_obtain_lock_attempts }} attempts."
42 that: won_lock|bool
43
44 - include_tasks: active-rule-set-tests.yaml
45
46 always:
47 - include_tasks: cleanup-lock.yaml