DevOps Classroom Series – 09/May/2021

Ansible enterprise Setup

  • Lets create 3 VMs
    • ubuntu 18 VMs => 2
    • centos 7 VM => 1
  • Once the 3 VMs are running
    • Lets create one user called as devops on all the three server and give this user sudo permissions without prompting for password
  • Creating user with password in Linux
    • Check if password logins are allowed
      • Change PasswordAuthentication to yes in /etc/ssh/sshd_config and restart sshd service using sudo service sshd restart
    • Now create a user called as devops
    sudo adduser devops
    • Lets add sudo permissions to the devops user without password
    sudo visudo
    • Repeat the same activity on the other ubuntu server
    • Repeat the same activity on the centos7
    sudo useradd devops
    sudo passwd devops
  • Install ansible on the control node (ubuntu)
  • Ansible has configurations present in /etc/ansible
  • Now lets create a configuration in such a way that devops user will be able to login into the nodes without prompting for passwords
    • Lets create a key pair in ansible control node
    • Now lets copy the public key to the nodes and let ssh verify the connection using keys
    ssh-copy-id devops@<ip of node>
    Preview Preview Preview *


Leave a Reply

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

About learningthoughtsadmin