Inventory is the Ansible way to track all the systems in your infrastructure. Here is a simple inventory file containing a single system and the login credentials for Ansible.
[targethost]
192.168.1.1 ansible_user=mrtuovinen ansible_ssh_pass=PassW0rd
project structure (ansible best practice).
project/
group_vars/
development
inventory.development
playbook.yaml
it all starts with inventory.development
[development]
dev.fakename.io
[development:vars]
ansible_host: 192.168.0.1
ansible_user: dev
ansible_pass: pass
ansible...
The host file is used to store connections for Anisble playbooks. There are options to define connection parameters:
ansible_host is the hostname or IP address
ansible_port is the port the machine uses for SSH
ansible_user is the remote user to connect as
ansible_ssh_pass if using a password to ...