Table of contents
No headings in the article.
Today, let's embark on an exciting journey into the world of Ansible through a hands-on video tutorial! ๐ฌโจ
Video Link: https://youtu.be/SGB7EdiP39E?si=fUA3_Th_R4JJOJPM
Task 01: Exploring Ansible Installation and Setup
Create an EC2 Instance: Launch a new EC2 instance on AWS to serve as our Ansible master node.
Connect via SSH: Access your EC2 instance using SSH to establish a connection.
Add Ansible PPA Repository: Add the Ansible PPA repository to your system using the command:
sudo apt-add-repository ppa:ansible/ansible
Update and Install Ansible: Update the package list and install Ansible using the following commands:
sudo apt update
sudo apt install ansible
Verify Ansible Version: Confirm the successful installation of Ansible by checking its version:
ansible --version
Launch Additional EC2 Instances: Create two new EC2 instances with the same private key as the Ansible master node.
Configure SSH Access: Copy the private key to the Ansible master server and set up SSH access to the new instances.
Create Inventory File: Set up an inventory file for Ansible by creating a hosts file inside the ansible folder. Add the IP addresses of the new servers to the hosts file.
Verify Inventory: Use the ansible-inventory command to verify the inventory of hosts:
ansible-inventory --list -y -i /path/to/inventory-file
Ping Command Test: Test connectivity to the new nodes by running a ping command using Ansible.
Resolve SSH Authentication Issues: If encountering SSH authentication errors, ensure correct permissions on the private key file and specify the private key file path in the Ansible command:
ansible -i /path/to/inventory-file all -m ping --private-key=/path/to/private-key
Additional Ad-hoc Commands
Check Memory Usage:
ansible -i /path/to/inventory-file all -a "free -m" --private-key=/path/to/private-key
Check Uptime:
ansible -i /path/to/inventory-file all -a uptime --private-key=/path/to/private-key
By following these steps and exploring Ansible in action, you'll gain invaluable insights into automation and configuration management. Stay tuned for more hands-on sessions and unleash the full potential of Ansible in your infrastructure management journey! ๐ป๐ง #DevOps #Ansible #Automation #ConfigurationManagement #HandsOnTutorial ๐โ๏ธ
Thank you for reading this Blog. Hope you learned something new today! If you found this blog helpful, please like, share, and follow me for more blog posts like this in the future.
You can connect with me at: https://www.linkedin.com/in/davendersingh/