Can't you just pull the git repo before you run the inventory?
On 20 June 2017 at 15:00, ishan jain <[email protected]> wrote: > I keep my inventory files for each environment in GIT repositories. I am > working on some sort of a helper service which i am writing in Ansible and > this should perform some (housekeeping) tasks on the specified servers, > which i wish to specify using existing inventory files. I want to make the > GIT repo as a parameter for this script and then the script will have its > target inventory file. I am not sure how to proceed from here. > > How can i load this inventory file within a task ? After loading, i can > either invoke next play or refresh the inventory with meta. Using add_host > doesn't seem to be an option as there are elaborate inventory configurations > which i want to reuse as it is rather than writing more logic to load it.I > don't see any lookup/parser either. The only option remains for me is to > keep the second phase logic in different playbook and after fetching the > inventory just shoot a shell command executing this playbook with the > inventory, but this method won't give me the logs like a regular playbook > execution. > > -- > 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/4e2c79d8-7190-4050-9977-ad994032794f%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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/CAK5eLPSYh-GSTyZ1fhdpWEtvniVqgz8bDAjKuV7SvUJB5LCk9g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
