Connect to Amazon Linux 2 server via SSH PuTTY and update the system using sudo yum update
, after that run sudo amazon-linux-extras install ansible2 -y
command on the amazon aws ssh terminal window to install ansible in linux 2 ec2 server.
How to Install Ansible on Amazon AWS Linux 2 EC2
Steps for installing and verifying Ansible on Amazon AWS Linux 2 EC2 instance server:
Step 1 – Login to Amazon AWS Linux 2 Console
Log into the AWS EC2 Management Console.
Step 2 – Connect to the AWS Linux 2 Instance via SSH
To connect your Amazon AWS linux 2 server from the SSH terminal, Open your putty or ssh and connect to from server.
If you are new to connect aws ec2 instance with Windows, ubuntu, and mac systems. A step-by-step guide on How to Connect to ec2 Instance From Putty and SSH Terminal.
Step 3 – Update the Package List
Run sudo yum update
command on aws ssh terminal window to update system package list:
sudo yum update
Step 4 – Install Ansible on Amazon Linux 2
To run the sudo amazon-linux-extras install ansible2 -y
command on aws ssh terminal window to install ansible in amazon aws linux 2 server:
sudo amazon-linux-extras install ansible2 -y
Step 5 – Verify Installation
To run the ansible --version
command on aws ssh terminal window to verify ansible installation in amazon aws linux 2 server:
ansible --version
This will print ansible version on aws ssh terminal window.
Conclusion
Through this tutorial, you have learned how to install Ansible on the amazon Linux 2 ec2 server.