Monday, 1 July 2019

How to install Ansible in Redhat /Ubuntu



 How to install Ansible in Redhat-

If you have "Subscription-Manager Register" on your system  than hit the below commands-

To enable the Ansible Engine repository for RHEL 7, run the following command:

 #sudo subscription-manager repos --enable rhel-7-server-ansible-2.8-rpms
 # sudu yum repolist
 #sudo yum install ansible
 # ansible -- version


If you have a Red Hat Ansible Engine Subscription: Than through command line-

Register the control node with Red Hat Subscription Manager(RHSM) and subscribe to the Ansible Engine

repository:
First register your system to RHSM:
# subscription-manager register
Attach your Red Hat Ansible Engine subscription. This command will help you find the Red Hat Ansible

Engine subscription:
# subscription-manager list --available
Grab the pool id of the subscription and run the following:
# subscription-manager attach --pool=<pool id here of engine subscription>
Enable the Red Hat Ansible Engine Repository:
# subscription-manager repos --enable rhel-7-server-ansible-VERSION-rpms
# subscription-manager repos --enable ansible-VERSION-for-rhel-8-x86_64-rpms
Install Ansible Engine:
# yum install ansible
# ansible -- version


========================

Install Ansible in Ubuntu

$ sudo apt update
$ sudo apt install software-properties-common
$ sudo apt-add-repository --yes --update ppa:ansible/ansible
$ sudo apt update
$ sudo apt install ansible

1 comment:

Anonymous said...

Helpful information.Thanks.