Comments on: How to Use Static and Dynamic Inventories in Ansible – Part 4 https://www.tecmint.com/use-static-and-dynamic-inventory-in-ansible/ Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks. Tue, 09 Mar 2021 19:55:04 +0000 hourly 1 By: derek https://www.tecmint.com/use-static-and-dynamic-inventory-in-ansible/comment-page-1/#comment-1448152 Tue, 09 Mar 2021 19:55:04 +0000 https://www.tecmint.com/?p=34811#comment-1448152 I love tecmint and this is another worthwhile link with an explanation of network inventory for ansible using JSON (i.e. an ex python step).

Please change “hostvars” to “vars” as my version of ansible issues a warning.

[derek@socorro JinaTemplates]$ ansible -i network.json –list-hosts all
[WARNING]: Skipping unexpected key (hostvars) in group (_meta), only “vars”, “children” and “hosts” are valid
hosts (8):
eng-pe2
eng-pe1
spn-2

]]>
By: Ravi Saive https://www.tecmint.com/use-static-and-dynamic-inventory-in-ansible/comment-page-1/#comment-1323479 Thu, 26 Mar 2020 06:30:39 +0000 https://www.tecmint.com/?p=34811#comment-1323479 In reply to Amedix.

@Amedix,

Thanks for the suggestion, corrected in the article…

]]>
By: Amedix https://www.tecmint.com/use-static-and-dynamic-inventory-in-ansible/comment-page-1/#comment-1323478 Thu, 26 Mar 2020 06:24:49 +0000 https://www.tecmint.com/?p=34811#comment-1323478 Hi,

Good Ansible articles!

May I suggest a syntax correction?

In the “Dynamic Host Inventory File” section, in the fourth line, change :

A dynamic inventory is a shell script written in Python, PHP or any other programming language.

by

A dynamic inventory is a script written in Python, PHP or any other programming language.

Thanks

]]>
By: Matt https://www.tecmint.com/use-static-and-dynamic-inventory-in-ansible/comment-page-1/#comment-1320221 Fri, 06 Mar 2020 08:37:21 +0000 https://www.tecmint.com/?p=34811#comment-1320221 Hi James,

After a dynamic inventory script successfully (using ./somescript –list) how do you use the JSON response as your hosts to execute a playbook?

]]>
By: QA https://www.tecmint.com/use-static-and-dynamic-inventory-in-ansible/comment-page-1/#comment-1303370 Sat, 07 Dec 2019 08:01:14 +0000 https://www.tecmint.com/?p=34811#comment-1303370 Yes, but I want to know the content of your Dynamic Inventory Script file, I searched a lot and I’m just a low-level person. I want JSON results like you, please let me know.
I would be happy to be able to get your contact

]]>