DevOps Classroom Series – 08/May/2021

Ansible Contd..

  • In Ansible the unit of work is module.
  • Lets try to use Ansible to install apache server on Ubuntu
    • Identify and execute the manual steps in configuring the apache server
    sudo apt update
    sudo apt install apache2 -y
    
    • Lets Execute these steps to verify if they are working
    • Ansible Steps:
      • Try to identify and create/edit inventory
      • Refer Here to understand playbook syntax
      • Searching modules in Ansible
        • Simple Approach: Google <cmd> in Ansible Preview
        • Any module in Ansible will have a state parameter
      • Refer Here for the playbook written in the class
      • Usage of Ansible Playbook Preview
      • To make this execution successful we need to provide inventory, playbook and private key
      ansible-playbook -i hosts --private-key  /home/ubuntu/ansible.pem apache.yaml
      
      Preview
  • Lets try to make our ansible lab setup more like an enterprise setup Preview
  • Things to explore before doing this
    • visudo
    • ssh-keygen
    • ssh configuration in /etc/ssh/sshd_config
    • enable/disable password based authentication in linux

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin