How to Install Ansible on Linux RHEL 7 with Subscription

How to Install Ansible on Linux RHEL 7 with Subscription
How to Install Ansible on Linux RHEL 7 with Subscription

How to Install Ansible on Linux RHEL 7 with Subscription - Ansible is an extra-simple tool/framework/API for doing 'remote things'.  this command allows you to define and run a single task 'playbook' against a set of hosts.

Preparation

Before installing you are required to enable the repository that you get when buying rhel 7, and the epel repository to take ansible from a third party in the following ways:

# subscription-manager register --username kitsake --password password --auto-attach --force
# subscription-manager repos --enable rhel-7-server-ansible-2.9-rpms

Installing

# yum install ansible
Install Ansible in Linux RHEL 7
Install Ansible in Linux RHEL 7

After finishing installing Ansible you can make sure that Ansible has been installed by looking at the version.

# ansible --version

Configure

let's try ansible by simply ordering a basic command to see the disk in the client.

so that ansible can run to the client, it is required that from server to client, they can log in without a password.

If you can't, you can follow the method first here: How to Setup SSH Login Without Password on RHEL 7

Continue to the next step, you must register the hosts client in the ansible settings.

# vi /etc/ansible/hosts
......

[webservers]

192.168.79.146

.....

save & exit

Trying

After you have done what follows from the explanation above. it's time for you to try it on the server that was installed earlier.

# ansible -m command -a "df -hT" -u root webservers
trying command check disk with ansible
trying command check disk with ansible

FYI : You can see examples of playbooks in several references. I recommend that you just look here Ansible Galaxy to see more examples of playbooks.

Bangkit Ade Saputra
Bangkit Ade Saputra At the end of the day, my job involves people. we're complicated, we're always changing, we have millions of things going on in our lives, and changing jobs is always a big decision.

Post a Comment for "How to Install Ansible on Linux RHEL 7 with Subscription"