Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
December 25, 2022 10:05 pm GMT

Installing Ansible on AWS EC2 Instance

Here in this blog post I will show you how to install Ansible on an AWS EC2 instance.

Bellow are the pre requisites

  1. Have an AWS account
  2. Spin and EC2 instance and connect to it via ssh or directly from your aws console .

For the purpose of this post I created an aws ubuntu instance.

After connecting to your instance run the commands bellow. This will make sure that your instance is up to get and that you got access to Ansible repos for install.

sudo apt update sudo apt-add-repository -y ppa:ansible/ansible

Once the steps above are done, now you may get started with the real deal by installing Ansible with the command bellow

sudo apt-get -y install ansible

After that, Ansible will be installed on your instance . You can now check the version with the command below

ansible --version

You will get the version of ansible installed along with the path to the configuration file.

asksouleyAnsibleVerion

Since the main goal of using Ansible is to automate our resource provisioning process, we will need to have boto3 installed. To learn more about boto3 , check my other blog post here

To install boto 3, just make sure that your instance is up to date one more time and running the command bellow

sudo apt updatesudo apt install python3-boto3

Just to make sure, you can also check that boto is installed by running the commands bellow

Method 1: pip show boto3Method 2: pip listMethod 3: pip list boto | greb boto

Let me know if you like it . I tried to make it as short as possible . Next will be how to automate the creation of EC2 instance using Ansible.

Like it?
Follow me on @asksouley


Original Link: https://dev.to/aws-builders/installing-ansible-on-aws-ec2-instance-fj9

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To