If you like the video please like , comment , share and subscribe the channel to get more updates on technical videos.
BUY ME A COFFEE AS A TOKEN OF APPRECIATION :
Youtube Channel Link:
Playlist Links:
AWS Playlist:
Datadog Playlist:
Prometheous and Grafana Monitoring:
Terraform Playlist:
Docker Playlist:
Yaml for DevOps Playlist:
Linux Playlist:
DevOps Playlist:
LInkedin:
Facebook :
Instagram:
Installing and configuring Ansible on Ubuntu EC2 instance:
Step 1: Install Ansible on Master EC2 Instance
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo apt-add-repository ppa:ansible/ansible
sudo apt update
sudo apt install ansible
ansible –version
Step 2: on Worker
sudo apt-get update
sudo apt-get install python
Step 3: Configure SSH Key-Based Authentication
On Master: ssh-keygen
id_ed25519.pub
on Slave: sudo nano .ssh/authorized_keys
Then add the key
4. Test SSH connection: from master
ssh ubuntu@public_ip
Step 5: Configure Ansible Inventory
sudo nano /etc/ansible/hosts
[Prodservers]
worker1 ansible_host=43.204.141.229 ansible_user=ubuntu
Step 6: Run a test
ansible Prodservers -m ping
ansible all -m ping
Step 7: Install Required Software on Slave
ansible all -m apt -a “name=nginx state=present” –become
Creating Playbook
Step 1: Create a Playbook
sudo nano install_apache.yml
—
– name: Install Apache on Worker EC2
hosts: Prodservers
become: yes
tasks:
– name: Update apt package manager
apt:
update_cache: yes
– name: Install Apache2
apt:
name: apache2
state: present
Step 2: Run the Playbook
ansible-playbook install_apache.yml
#ansible
#devops
#aws
#Ansible #Automation #DevOps #InfrastructureAsCode #ConfigurationManagement #Orchestration #ITAutomation #AnsiblePlaybooks #AnsibleRoles #AnsibleModules #AnsibleTower #ContinuousIntegration #ContinuousDeployment #DeploymentAutomation #InfrastructureAutomation #CloudAutomation #DevOpsTools #AnsibleTutorial #AnsibleTraining #LearnAnsible #ITOps #SysAdmin #PythonAutomation #NetworkAutomation #AnsibleBestPractices #AnsibleSecurity #AnsibleGalaxy #AnsibleCommunity #AnsibleScripts #AnsibleConfiguration #AnsibleVariables #AnsibleInventory #AutomationEngineer #DevOpsEngineer #InfrastructureEngineer #AnsibleWorkflow #AnsibleIntegration #AnsibleForBeginners #AnsibleCertification #AnsibleJobs #AnsibleTasks #AnsibleTips #AnsibleTricks #AnsibleUpdates #Ansible2024 #AnsibleCourse #AnsibleOnlineCourse #AnsibleYouTubeTutorial #AnsibleStepByStep #AnsibleCompleteTutorial
source