Hi Jon,

Thanks for the answer but it's not dynamic, as I said, I don't know in 
advance which will be the servers where the playbook should run on.

Any idea ?

Thanks

Le jeudi 25 mai 2017 15:39:24 UTC+2, J Hawkesworth a écrit :
>
> How about you add server1 and server2 to a group in your inventory - 
> something like this
>
> [application_servers]
> server1
> server2
>
>
>  and then change  sites/playbook.yml so it does 
>
> hosts: application_servers
>
>
> instead of 
>
> hosts: all
>
>
> If you want to run the same playbook on different server types, you can 
> specify multiple host groups in your 'hosts' line
>
> hosts: application_servers:webservers:database_servers
>
> Hope this helps
>
> Jon
>
>
>
>
> On Thursday, May 25, 2017 at 6:34:41 AM UTC+1, Pierre Mavro wrote:
>>
>> Hi,
>>
>> I have to run something like this in a playbook task:
>>
>> ansible-playbook sites/playbook.yml --limit=server1,server2
>>
>> I would like to include this playbook in another playbook. How to add the 
>> --limit parameter:
>>
>> - name: my run list
>>   hosts: localhost
>>   connection: local
>>   gather_facts: False
>>   tasks:
>>     - include: sites/playbook.yml
>>     - name: my other tasks
>>     ...
>>
>> The --limit parameter content is generated on the fly, so I don't know in 
>> advance the servers where the playbook will be applied.
>>
>> Any ideas ?
>>
>> Thanks
>>
>

-- 
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/295c649a-d466-4cab-8f8d-d49ee2647f48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to