Previous Lecture Complete and continue  

  Ansible Hosts File

The Ansible Inventory or Hosts file is where Ansible stores all the connectivity for all the hosts you want to manage with Ansible.

The format is a text file in the following format

[Switches]
3560-SW1
2960-SW1

[Routers]
CSR-01 ansible-host=192.168.1.200

Note: The name of your device must be resolvable in DNS, if it is not you will have to add the line ansible-host-<ip address> to each entry

You can also just put the IP address, but this makes things confusing when referencing IP's in playbooks, it's much easier to do it by names

The Ansible Documentation can be found here - http://docs.ansible.com/ansible/latest/intro_inven...