How would the following information be formatted in an Inventory file for Ansible:
amh[1:2] Hosts info: amh1.example.com IP: 192.168.10.10 MAC: 00:15:5d:74:0f:07 amh2.example.com IP: 192.168.10.11 MAC: 00:15:5d:74:0f:08
all: children: amh: hosts: amh1: ansible_host: 192.168.10.10 mac_address: "00:15:5d:74:0f:07" amh2: ansible_host: 192.168.10.11 mac_address: "00:15:5d:74:0f:08"
Chetan,
I like what I see!
Regarding the "ansible_host" variable, I noticed that you
chose to use the IP address of each host, instead of its FQDN.
Any particular reason you chose that route?
@Trevor totaly depends upon your setup - if you trust your DNS fqdn is fine ( and it is easier to read the fqdn for humans , I agree ) else you can mention the IP :
https://docs.ansible.com/ansible/latest/getting_started/get_started_inventory.html
https://docs.ansible.com/ansible/latest/inventory_guide/intro_inventory.html#behavioral-parameters
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.