Do you really need variables in includes?
I have something similar, a file named cluster.yml which only includes
other files:
---
- include: webservers.yml
- include: dbservers.yml
and each of those files has, e.g.
---
- hosts: webservers
roles:
- web
- cache
---
- hosts: dbservers
roles:
- db
And each of the roles, db and web, have a dependency
(http://docs.ansible.com/ansible/playbooks_roles.html#role-dependencies) on
a role called "common" which installs generic packages and has handlers
such as "restart syslog".
On Friday, 14 August 2015 14:59:12 UTC+2, Pujan Shah wrote:
>
> Hi,
>
> I want to use include in a way that every host get's different playbook.
>
> This is important for me as I have some tasks that are specific to each
> host.
>
> I can create a custom role where I keep all "semi-manual" and use once
> stuff related to all hosts in somthing like host_a.yml host_b.yml
> host_c.yml and than in main playbook I can call include host_{{
> inventory_hostname }}.yml
>
> This way all my semi-manual and host specific things are also part of my
> whole setup.
>
> I am not sure if this is possible right now or not but from looking at
> https://github.com/ansible/ansible/issues/5424 I think it's not possible.
>
> I can do include_vars this way but not simple include.
>
> Can someone suggest better alternative if this is not possible?
>
> Regards
> Pujan
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/7ce4bf4c-6d18-4d09-b2bf-fb3a51c04ef9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.