This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
ansible:ansible_inventory [2025/11/18 14:06] manu |
ansible:ansible_inventory [2025/11/18 14:14] (current) manu |
||
|---|---|---|---|
| Line 6: | Line 6: | ||
| Convert a ini file to | Convert a ini file to | ||
| - | * JSON : ansible-inventory -i /etc/ansible/hosts --list | + | * JSON : <code>ansible-inventory -i /etc/ansible/hosts --list</code> |
| - | * YAML : ansible-inventory -i /etc/ansible/hosts --list --yaml | + | * YAML : <code>ansible-inventory -i /etc/ansible/hosts --list --yaml</code> |
| + | You can add **--vars** to add associated variable for each group/hosts | ||
| Example of Collection of groups Dev:children | Example of Collection of groups Dev:children | ||