Skip to content
Snippets Groups Projects
Commit 5261ec8e authored by jurgenhaas's avatar jurgenhaas
Browse files

ansible-playbooks/general#72 Always use import_tasks or include_tasks instead of just include

parent 795c7723
No related branches found
No related tags found
No related merge requests found
...@@ -36,8 +36,7 @@ ...@@ -36,8 +36,7 @@
state: present state: present
with_items: '{{ ec2.instance_ids }}' with_items: '{{ ec2.instance_ids }}'
- include_tasks: inithostip.yml hostip='{{ inithostip }}' - import_tasks: inithostip.yml hostip='{{ inithostip }}'
tags: 'always'
when: inithostip is defined when: inithostip is defined
...@@ -46,4 +45,3 @@ ...@@ -46,4 +45,3 @@
loop_control: loop_control:
loop_var: ec2instance loop_var: ec2instance
when: inithostip is not defined when: inithostip is not defined
tags: 'always'
--- ---
# file: inithost.yml # file: inithost.yml
- include_tasks: "cleanup.yml" - import_tasks: "cleanup.yml"
tags: 'always'
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
- block: - block:
- include: "{{ cloud|default('none') }}/{{ mode }}.yml" - import_tasks: "{{ cloud|default('none') }}/{{ mode }}.yml"
- include: "{{ mode }}.yml" - import_tasks: "{{ mode }}.yml"
when: '"cloud" not in excluded_roles' when: '"cloud" not in excluded_roles'
--- ---
# file: removehost.yml # file: removehost.yml
- include_tasks: "cleanup.yml" - import_tasks: "cleanup.yml"
when: are_you_sure == "YES" when: are_you_sure == "YES"
tags: 'always'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment