Lab 2 - Ansible Configuration & Inventory¶
Mandatory¶
Create the Ansible Configuration¶
Connect to your
srv.<firstname>.labasansibleuserSwitch into your git repo
/home/ansible/trainingCreate a
ansible.cfgfile and configure- inventory path to
hosts - enable
become
- inventory path to
Create a static inventory¶
Create a
hostsfileadd all your servers to the inventory file
- web1.<firstname>.lab
- web2.<firstname>.lab
- db.<firstname>.lab
Important
Don’t add srv.firstname.lab in your inventory.
Run some Ansible commands¶
- Run
unameon all servers - Run
whoamion all servers
Commit your changes¶
- add all files to your git repo and commit it