Hi,
I'm trying to include a play from different play book. The structure is as follows:
---
- hosts: localhost
vars_files:
- /etc/ansible/parent/parent.yml
tasks:
- name: Template the component properties files
template:
src=/etc/ansible/templates/{{item}}.j2
dest=/etc/ansible/templates/{{item}}/service-container.properties
with_items:
- [ 'router', 'report-scheduler', 'WH-Payload-Processor']
tasks:
- include: /etc/ansible/playbooks/wrapper.yml
---
- hosts: localhost
tasks:
- name: Template the wrapper.conf file
template:
src=/etc/ansible/templates/wrapper.j2
dest=/etc/ansible/templates/router/wrapper.conf
vars:
- serviceName: router
However i get the error "no task detected". what is the issue here?
=>Also is this feasible:
---
- hosts: localhost
vars_files:
- /etc/ansible/parent/parent.yml
tasks:
- name: Template the component properties files
template:
src=/etc/ansible/templates/{{item}}.j2
dest=/etc/ansible/templates/{{item}}/service-container.properties
with_items:
- [ 'router', 'report-scheduler', 'WH-Payload-Processor']
tasks:
- include: /etc/ansible/playbooks/wrapper.yml some_var={{item}}
with_items
- router
- gateway
- resource
---
- hosts: localhost
tasks:
- name: Template the wrapper.conf file
template:
src=/etc/ansible/templates/wrapper.j2
dest=/etc/ansible/templates/{{item}}/wrapper.conf
vars:
- serviceName: {{item}}