Let's get our hands dirty with Ansible and tasks using AWS EC2. We'll go over how to install and remove a package using Ansible.
A few months ago, I did some RnD tasks using ansible at VizuaMatix. After that I didn't use Ansible for anything useful, today I got a YouTube suggestion for ansible again. After watching it I thought, I should get my hands dirty again with Ansible. I decided to do some Ansible tasks using AWS EC2.
For this, I have used a master node and a worker node. Both running Ubuntu 18.04.4 And the task was very simple. Install the VLC media player in our worker node, and then removing it.
First thing first, we must have Ansible installed in master and worker/s. To install just use :
sudo apt install ansible
Then we need to share our master’s public-key to worker/s. We create a ssh key from the master node and share it with worker node/s.
ssh-keygen -t rsa -N “” -f /home/ubuntu/.ssh/id_rsa
Then cat and copy the content
Go to worker/s terminal and
vim ~/.ssh/authorized_keys paste the content at the bottom of this file, save and exit. This step was explained here.
and check the connectivity, from master node try :
If our key sharing is successful, then you should be able to login to the worker node without any password.
Then let's add our worker node/s to ansible. In master node, open
/etc/ansible/hosts the file and add a group to it. Here I have named it as
[workers] . Now onward, when you specify
workers in your playbook, ansible knows what hosts to use when running the playbook.
Save and then let's try to ping our worker node/s :
ansible workers -m ping
DevOps and Cloud computing are joined at the hip, now that fact is well appreciated by the organizations that engaged in SaaS cloud and developed applications in the Cloud. During the COVID crisis period, most of the organizations have started using cloud computing services and implementing a cloud-first strategy to establish their remote operations. Similarly, the extended DevOps strategy will make the development process more agile with automated test cases.
AWS DevOps: Introduction to DevOps on AWS
What is DevOps? How are organizations transitioning to DevOps? Is it possible for organizations to shift to enterprise DevOps? Read more to find out!
You will be understanding the various DevOps Tools and their deployment on AWS Cloud. Towards the end, we'll also be doing a hands-on to put all this knowledge into action!
What is DevOps? What are the goals it helps achieves? What are its benefits? This article has answers!