Why we use -i inventory command while executing ansible playbook. and also in Ansible playbook lab(ansible for beginner) , question 15 , the same command is not working
The flag -i
in the ansible-playbook command refers to the inventory file, which stores the information about the servers we want the actions to be performed.
Q15 of the Ansible Playbooks lab does not require you to run the playbook, instead, it requires updating the playbook and adding a name field to it.
The current playbook perform the tasks on localhost. The error you might be facings is because there is no inventory file in the directory.
The task of running the playbooks using the inventory file is from Q18.
Regards.
Thanks for your help Santosh