I suggest you create some groups in your inventory, so instead of 
- hosts: all

you run against
- hosts: webservers

(obviously webservers is just an example of a group).

This is nice when reading playbooks as you instantly get a notion of what 
roles are needed on the different types of server you are managing.

Hope this helps,

Jon

On Thursday, September 22, 2016 at 2:33:51 AM UTC+1, Andrew wrote:
>
> Is it possible to limit the hosts that run against a nested playbook? For 
> example, I have a site.yml file that includes other playbooks like so:
>
> ---
> - hosts: all
>   roles:
>     - foo
>
> - include: foo.yml
>
> For the foo playbook I'd only want a subset of hosts to get evaluated. 
> Some googling pointed me at trying the following syntax but it doesn't seem 
> to work:
>
> ---
> - hosts: all
>   roles:
>     - foo
>
> - include: foo.yml hosts=bar
>
> This results in syntax errors. Is this possible?
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f02df6b0-7406-4d44-9129-a07af50ade62%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to