Skip to content
Snippets Groups Projects
Commit 765aaa9b authored by jurgenhaas's avatar jurgenhaas
Browse files

ansible-playbooks/general#85 Name import and include tasks

parent 519bae26
No related branches found
No related tags found
No related merge requests found
......@@ -39,11 +39,13 @@
state: present
with_items: '{{ ec2.instance_ids }}'
- import_tasks: inithostip.yml hostip='{{ inithostip }}'
- name: Import inithostip
import_tasks: inithostip.yml hostip='{{ inithostip }}'
when: inithostip is defined
- include_tasks: inithostip.yml hostip='{{ ec2instance.public_ip }}'
- name: Include inithostip
include_tasks: inithostip.yml hostip='{{ ec2instance.public_ip }}'
with_items: '{{ ec2.instances }}'
loop_control:
loop_var: ec2instance
......
---
# file: inithost.yml
- import_tasks: "cleanup.yml"
- name: Import cleanup
import_tasks: "cleanup.yml"
......@@ -9,8 +9,10 @@
- block:
- import_tasks: "{{ cloud|default('none') }}/{{ mode }}.yml"
- name: Import cloud mode
import_tasks: '{{ cloud|default("none") }}/{{ mode }}.yml'
- import_tasks: "{{ mode }}.yml"
- name: Import mode
import_tasks: '{{ mode }}.yml'
when: not excluded_roles or "cloud" not in excluded_roles
---
# file: removehost.yml
- import_tasks: "cleanup.yml"
- name: Import cleanup
import_tasks: 'cleanup.yml'
when: are_you_sure == "YES"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment