An Ansible playbook needs completion on the jump host, where a team member left off. Below are the details:
The inventory file /home/thor/ansible/inventory requires adjustments. The playbook must run on App Server 2 in Stratos DC. Update the inventory accordingly.
Create a playbook /home/thor/ansible/playbook.yml. Include a task to create an empty file /tmp/file.txt on App Server 2.
Note: Validation will run the playbook using the command ansible-playbook -i inventory playbook.yml. Ensure the playbook works without any additional arguments.
Move into ansible directory:
cd ansible
ls
Fix the inventory file:
stapp02 ansible_host=172.238.16.204 ansible_user=steve ansible_ssh_common_args='-o StrictHostKeyChecking=no'
The host is not the correct one for app server 2. replace host ip with hostname of app server 2:
stapp02and addansible_ssh_password
stapp02 ansible_host=stapp02 ansible_user=steve ansible_ssh_password=Am3ric@ ansible_ssh_common_args='-o StrictHostKeyChecking=no'
Create a playbook.yml file and copy-paste contents from this playbook file
Run the playbook command:
ansible-playbook -i inventory playbook.yml
-v, -vv, -vvv for detailed output--check for dry-run execution--limit to target specific hosts--step for interactive execution