Skip to content

Commit

Permalink
Moving cleaning up molecule_instance_config tasks to the of the block…
Browse files Browse the repository at this point in the history
…, because this task changes the when condition of the block immediately and following tasks will be skipped regardless ot their when condition.
  • Loading branch information
klaphi authored and apatard committed Jan 22, 2025
1 parent d511fe6 commit 613b885
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,6 @@
until: ec2_instances is finished
retries: 300

- name: Write Molecule instance configs
ansible.builtin.copy:
dest: "{{ molecule_instance_config }}"
content: "{{ {} | to_yaml }}"

- name: Destroy ephemeral security groups (if needed)
amazon.aws.ec2_security_group:
profile: "{{ item.aws_profile | default(omit) }}"
Expand All @@ -142,4 +137,9 @@
index_var: index
label: "{{ item.name }}"
when: item.key_inject_method == "ec2"

- name: Write Molecule instance configs
ansible.builtin.copy:
dest: "{{ molecule_instance_config }}"
content: "{{ {} | to_yaml }}"
{%- endraw %}

0 comments on commit 613b885

Please sign in to comment.