100-Days-Of-DevOps-Challenge-KodeKloud

Troubleshoot and Create Ansible Playbook

An Ansible playbook needs completion on the jump host, where a team member left off. Below are the details:

Note: Validation will run the playbook using the command ansible-playbook -i inventory playbook.yml. Ensure the playbook works without any additional arguments.

Steps

  1. Move into ansible directory:

     cd ansible
     ls
    
  2. 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: stapp02 and add ansible_ssh_password

     stapp02 ansible_host=stapp02 ansible_user=steve ansible_ssh_password=Am3ric@ ansible_ssh_common_args='-o StrictHostKeyChecking=no'
    
  3. Create a playbook.yml file and copy-paste contents from this playbook file

  4. Run the playbook command:

     ansible-playbook -i inventory playbook.yml
    

Good to Know?

Ansible Troubleshooting

Common Issues

Debugging Techniques

File Operations