100-Days-Of-DevOps-Challenge-KodeKloud

Ansible Install Package

The Nautilus Application development team wanted to test some applications on app servers in Stratos Datacenter. They shared some pre-requisites with the DevOps team, and packages need to be installed on app servers. Since we are already using Ansible for automating such tasks, please perform this task using Ansible as per details mentioned below:

Note: Validation will try to run playbook using command ansible-playbook -i inventory playbook.yml so please make sure playbook works this way, without passing any extra arguments.

Steps

  1. Move into playbook directory

     cd playbook
    
  2. Create two files inventory and playbook.yml:

     touch inventory playbook.yml
    
  3. Update inventory file with these contents:

     [app]
     stapp01 ansible_user=tony ansible_ssh_password=Ir0nM@n
     stapp02 ansible_user=steve ansible_ssh_password=Am3ric@
     stapp03 ansible_user=banner ansible_ssh_password=BigGr33n
    
     [all:vars]
     ansible_ssh_common_args='-o StrictHostKeyChecking=no'
    
  4. Update the playbook.yml with the contents from this playbook YAML file

  5. Run the ansible playbook command:

     ansible-playbook -i inventory playbook.yml
    

Good to Know?

Ansible Package Management

Package Operations

Package Management Best Practices

Cross-Platform Considerations