Re: [ansible-project] Updating Ansible hosts inventory dynamically
On 01.02.2019 21:13, Subhi Andrews wrote: Thank you, Kai. Will check it out. So if we can write a script that generates inventory in json format, we can directly pass the script to the ansible-playbook command? Did I understand that correctly? That is correct, if a inventory file doesn't have the execution bit set Ansible will read the content, if the execution bit is set Ansible will run the file. The script need to return json and the format is described here together with how to develop a plugin https://docs.ansible.com/ansible/latest/dev_guide/developing_inventory.html -- Kai Stian Olstad -- 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/fd32607916e939b624c108d7e207e2a1%40olstad.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Updating Ansible hosts inventory dynamically
Thank you, Kai. Will check it out. So if we can write a script that generates inventory in json format, we can directly pass the script to the ansible-playbook command? Did I understand that correctly? Regards, On Fri, Feb 1, 2019 at 11:26 AM Kai Stian Olstad < ansible-project+l...@olstad.com> wrote: > On 01.02.2019 20:09, Subhi Andrews wrote: > > We have our hosts inventory organized by environments. We tend to have > > alpha versions of software deployed in our test environment. Are there > > any > > thoughts on keeping the inventory dynamically updated if we decide to > > move > > a host between environment - say from test to dev or from dev to > > production > > etc. Are there any best practices and such around it? > > You have information in the documentation about dynamic inventory > > https://docs.ansible.com/ansible/latest/user_guide/intro_dynamic_inventory.html > > Some plugins is created > https://docs.ansible.com/ansible/latest/plugins/inventory.html > > If non of them suite your need you probably need to create your own. > > -- > Kai Stian Olstad > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Ansible Project" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/ansible-project/SwwNRlEoqyY/unsubscribe. > To unsubscribe from this group and all its topics, 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/2c62a4977194d117f83ef0fdfbd6e650%40olstad.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 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/CAPkR6y0Gz%3D%2BoJYmM%3DTEwSxgDY-eixnFu7%2BTyJWzcCcQ%3D_%3D-gfA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-project] Updating Ansible hosts inventory dynamically
On 01.02.2019 20:09, Subhi Andrews wrote: We have our hosts inventory organized by environments. We tend to have alpha versions of software deployed in our test environment. Are there any thoughts on keeping the inventory dynamically updated if we decide to move a host between environment - say from test to dev or from dev to production etc. Are there any best practices and such around it? You have information in the documentation about dynamic inventory https://docs.ansible.com/ansible/latest/user_guide/intro_dynamic_inventory.html Some plugins is created https://docs.ansible.com/ansible/latest/plugins/inventory.html If non of them suite your need you probably need to create your own. -- Kai Stian Olstad -- 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/2c62a4977194d117f83ef0fdfbd6e650%40olstad.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Updating Ansible hosts inventory dynamically
We have our hosts inventory organized by environments. We tend to have alpha versions of software deployed in our test environment. Are there any thoughts on keeping the inventory dynamically updated if we decide to move a host between environment - say from test to dev or from dev to production etc. Are there any best practices and such around it? Thank you. -- 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/b4dec466-c9b0-46f9-9435-616ba290ffd0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.