DevOps Classroom notes 27/Feb/2025

Ansible Setup

  • Overview
    Preview
  • Pre-reqs:

    • Servers should be reachable from Ansible control node
    • Servers should have python3 installed
  • Steps:
    • Create a user devops and give this user sudo permissions
    • Install Ansible on the control node
    • Test the setup

Linux Instances – Login

  • SSH (Secure Shell) is protocol used to login into linux instances which on a broader note supports two types
    • password based authentication
    • key based authentication
  • Windows earlier didn’t had inbuild ssh clients now on all latest distributions from windows 11, ssh clients are part of windows
  • SSH Command For password based ssh <username>@<ip/name-server>

Ansible installation on Azure

  • Both distributions will be ubuntu 24.04.
  • This installation will be going on the linux machines with password enabled
  • Creating linux machine on Azure (Watch classroom recording) or Refer Here
  • Created two ubuntu vms ansible-control-node and node- in the same network with os ubuntu-24.04 and username devops
  • Lets create inventory, create a new file on ansible control node hosts with node-1 s private ip
  • Now lets install ansible on ubuntu
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo apt install ansible -y
  • To verify ansible installation ansible --version
    Preview

Ansible ping

  • Ansible ping will verify if the ansible control node to node configuration is done correctly or not
  • This also requires inventory
  • The command is ansible -m ping -i hosts all, This command expects the credentials to be keys
  • Ensure you perform a manual ssh into node from control node as it generates an entry in known_hosts file which is used by ansible for password based authenticates
  • Since we are using password based our command would be ansible -m ping -k -i hosts all

Preview

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

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

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube