ansible --version
ansible-playbook --version
ansible-galaxy --version
Now , we have the Ansible installed
Now we need the inventory
The inventory file needs to be managed by ansible
Every change to the inventory file should be able to be tracked
we can have this inventory file anywhere
Lets say that , the inventory file is in our home directory by the name dev
The inventories are grouped by their function and the name of the Function being their role/Function
Now we know that their role/Function is what the group name is , it is easier to track the hosts in the Inventory
As we know the name of the file dev
executing this command
ansible --list-hosts all , will check the list of the hosts from the Default system inventory which is
/etc/ansible/hosts
If we want to display the names of the hosts from a particular locaiton in the inventory , then we do tha following
We source in the name of the inventory file from the location where it is
ansible -i filename --list-hosts all
This will display the hosts that are in the filename
COMMANDS:
ansible --list-hosts all and ansible -i filename --list-hosts all
No comments:
Post a Comment