From d027722bc03d95c03f6908cee370c6e6d931a056 Mon Sep 17 00:00:00 2001 From: Philipp Klabinus Date: Tue, 8 Oct 2024 20:51:07 +0200 Subject: [PATCH] Moving cleaning up molecule_instance_config tasks to the of the block, because this task changes the when condition of the block immediately and following tasks will be skipped regardless ot their when condition. --- .../{{cookiecutter.scenario_name}}/destroy.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/molecule_plugins/ec2/cookiecutter/{{cookiecutter.molecule_directory}}/{{cookiecutter.scenario_name}}/destroy.yml b/src/molecule_plugins/ec2/cookiecutter/{{cookiecutter.molecule_directory}}/{{cookiecutter.scenario_name}}/destroy.yml index e468a534..4de958ee 100644 --- a/src/molecule_plugins/ec2/cookiecutter/{{cookiecutter.molecule_directory}}/{{cookiecutter.scenario_name}}/destroy.yml +++ b/src/molecule_plugins/ec2/cookiecutter/{{cookiecutter.molecule_directory}}/{{cookiecutter.scenario_name}}/destroy.yml @@ -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) }}" @@ -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 %}