DevOps Classroomnotes 26/May/2023

Installing and Configuring Ansible

  • We will create two ubuntu vms
  • Create a user called devops in two vms with sudo permissions
  • Create a key-pair in ansible control node & copy the public key to other vm from ansible control node
  • Installing ansible
sudo apt update
sudo apt install software-properties-common -y
sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo apt install ansible -y
  • Verify ansible version
  • Now lets add inventory. Create a file called as hosts with one entry <ipaddress>
  • Check connectivity by executing ansible -m ping -i hosts all
  • Note:
    • To enable password authentications edit config /etc/ssh/sshd_config and set PasswordAuthentication to yes from no
    • restart sshd service sudo service sshd restart

Linux Topics

  • User management
  • sudo
  • key management (ssh-keygen, ssh-copy-id)
  • package management (apt, yum, dnf)
  • file editing (nano, vim)

Leave a Reply

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

About continuous learner

devops & cloud enthusiastic learner