Debian Codegraph @

ansible_collections/community/aws/tests/integration/targets/autoscaling_lifecycle_hook/main.yml

raw
1 ---
2 # Beware: most of our tests here are run in parallel.
3 # To add new tests you'll need to add a new host to the inventory and a matching
4 # '{{ inventory_hostname }}'.yml file in roles/ec2_asg_lifecycle_hook/tasks/
5 # Prepare the VPC and figure out which AMI to use
6 - hosts: all
7 gather_facts: false
8 tasks:
9 - module_defaults:
10 group/aws:
11 access_key: "{{ aws_access_key }}"
12 secret_key: "{{ aws_secret_key }}"
13 session_token: "{{ security_token | default(omit) }}"
14 region: "{{ aws_region }}"
15 vars:
16 # We can't just use "run_once" because the facts don't propagate when
17 # running an 'include' that was run_once
18 setup_run_once: true
19 block:
20 - ansible.builtin.include_role:
21 name: setup_ec2_facts
22 - ansible.builtin.include_role:
23 name: ec2_asg_lifecycle_hook
24 tasks_from: env_setup.yml
25 rescue:
26 - ansible.builtin.include_role:
27 name: ec2_asg_lifecycle_hook
28 tasks_from: env_cleanup.yml
29 run_once: true
30 - ansible.builtin.fail:
31 msg: Environment preparation failed
32 run_once: true
33
34 # VPC should get cleaned up once all hosts have run
35 - hosts: all
36 gather_facts: false
37 strategy: free
38 serial: 6
39 roles:
40 - ec2_asg_lifecycle_hook