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 <ritesh....@gmail.com > <javascript:>> 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 ansible-proje...@googlegroups.com <javascript:>. >> To post to this group, send email to ansible...@googlegroups.com >> <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/ansible-project/1c91803b-dade-471f-88e0-c0f9a1163030%40googlegroups.com >> >> <https://groups.google.com/d/msgid/ansible-project/1c91803b-dade-471f-88e0-c0f9a1163030%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> 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 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/230076ba-36d2-4dd5-a815-3cb53f410f62%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.