don't use variables that overlap with keywords, use 'targets' instead
of 'hosts', for example

On Fri, May 15, 2015 at 7:19 PM, Bob Brown <[email protected]> wrote:
> Not sure exactly what you mean by "accept arguments".
>
> You can do something like add the varible into the play book
>
>    hosts: ' {{ hosts }}'
>
> and then when you run the playbook you can say something like
>
> ansible-playbook -e "hosts=HOSTNAME" playbook.yml
> OR better yet, use the inventory generated tag names lik
> ansible-playbook -e "hosts=tag_Name_cronbox-ops1-cronbox" playbook.yml
>
> In "-e" you can add several value pairs that will act as variables.
>
> Bob
>
>
> On Thursday, May 14, 2015 at 11:44:08 AM UTC-7, Matt Martz wrote:
>>
>> Dynamic inventory scripts only accept 2 arguments that ansible will
>> actively attempt to call:  --host and --list.
>>
>> To provide additional configuration, your inventory script could have a
>> config file, or utilize ENV vars as suggested in the other posts you have
>> read.
>>
>> On Thu, May 14, 2015 at 1:30 PM, Ritesh Shetty <[email protected]>
>> wrote:
>>>
>>> Hello !
>>> I have read through some forum posts that i could use env variables but i
>>> really do not want to do so. So wanted to know if ansible dynamic inventory
>>> can accept a variable
>>>
>>>
>>> Ritesh
>>>
>>> --
>>> 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/1c91803b-dade-471f-88e0-c0f9a1163030%40googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>>
>> --
>> Matt Martz
>> @sivel
>> sivel.net
>
> --
> 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/230076ba-36d2-4dd5-a815-3cb53f410f62%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 
Brian Coca

-- 
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/CAJ5XC8mzaBNOAGdV8fC8Sf%2BJPqLY70Wkp4-zN%2BiL9deFaski6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to