Steps to install Ansible on RHEL 6 or CentOS 6.
Today in this post, we will see a very useful and quick tip how to install ansible on RHEL 6 or CentOS 6.
Lets have a look step by step.
1. Configure the repository.
[root@ngelinux001 yum.repos.d]# pwd /etc/yum.repos.d [root@ngelinux001 yum.repos.d]# cat epel.repo [epel] name=Extra Packages for Enterprise Linux 6 - $basearch baseurl=http://archives.fedoraproject.org/pub/archive/epel/6/x86_64/ #mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch failovermethod=priority enabled=1 gpgcheck=0
2. Now install the ansible with new repo.
[root@ngelinux001 yum.repos.d]# yum install ansible
Loaded plugins: aliases, changelog, downloadonly, kabi, presto, product-id, refresh-packagekit, security, subscription-manager,
: tmprepo, verify, versionlock
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Loading support for Red Hat kernel ABI
epel | 4.7 kB 00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ansible.noarch 0:2.6.20-1.el6 will be installed
--> Processing Dependency: PyYAML for package: ansible-2.6.20-1.el6.noarch
--> Processing Dependency: python-crypto2.6 for package: ansible-2.6.20-1.el6.noarch
--> Processing Dependency: python-httplib2 for package: ansible-2.6.20-1.el6.noarch
--> Processing Dependency: python-jinja2-26 for package: ansible-2.6.20-1.el6.noarch
--> Processing Dependency: python-keyczar for package: ansible-2.6.20-1.el6.noarch
--> Processing Dependency: python-six for package: ansible-2.6.20-1.el6.noarch
--> Processing Dependency: sshpass for package: ansible-2.6.20-1.el6.noarch
--> Running transaction check
---> Package PyYAML.x86_64 0:3.10-3.1.el6 will be installed
--> Processing Dependency: libyaml-0.so.2()(64bit) for package: PyYAML-3.10-3.1.el6.x86_64
---> Package python-crypto2.6.x86_64 0:2.6.1-2.el6 will be installed
---> Package python-httplib2.noarch 0:0.18.1-1.el6 will be installed
---> Package python-jinja2-26.noarch 0:2.6-3.el6 will be installed
---> Package python-keyczar.noarch 0:0.71c-1.el6 will be installed
--> Processing Dependency: python-pyasn1 for package: python-keyczar-0.71c-1.el6.noarch
---> Package python-six.noarch 0:1.9.0-2.el6 will be installed
---> Package sshpass.x86_64 0:1.06-1.el6 will be installed
--> Running transaction check
---> Package libyaml.x86_64 0:0.1.3-4.el6_6 will be installed
---> Package python-pyasn1.noarch 0:0.0.12a-1.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================
Installing:
ansible noarch 2.6.20-1.el6 epel 10 M
Installing for dependencies:
PyYAML x86_64 3.10-3.1.el6 base 157 k
libyaml x86_64 0.1.3-4.el6_6 base 52 k
python-crypto2.6 x86_64 2.6.1-2.el6 epel 513 k
python-httplib2 noarch 0.18.1-1.el6 epel 121 k
python-jinja2-26 noarch 2.6-3.el6 epel 527 k
python-keyczar noarch 0.71c-1.el6 epel 219 k
python-pyasn1 noarch 0.0.12a-1.el6 base 70 k
python-six noarch 1.9.0-2.el6 base 28 k
sshpass x86_64 1.06-1.el6 epel 20 k
Transaction Summary
================================================================================================================================
Install 10 Package(s)
Total size: 12 M
Installed size: 59 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : python-httplib2-0.18.1-1.el6.noarch 1/10
Installing : python-crypto2.6-2.6.1-2.el6.x86_64 2/10
Installing : python-jinja2-26-2.6-3.el6.noarch 3/10
Installing : python-pyasn1-0.0.12a-1.el6.noarch 4/10
Installing : python-keyczar-0.71c-1.el6.noarch 5/10
Installing : libyaml-0.1.3-4.el6_6.x86_64 6/10
Installing : PyYAML-3.10-3.1.el6.x86_64 7/10
Installing : sshpass-1.06-1.el6.x86_64 8/10
Installing : python-six-1.9.0-2.el6.noarch 9/10
Installing : ansible-2.6.20-1.el6.noarch 10/10
Verifying : PyYAML-3.10-3.1.el6.x86_64 1/10
Verifying : python-six-1.9.0-2.el6.noarch 2/10
Verifying : sshpass-1.06-1.el6.x86_64 3/10
Verifying : python-keyczar-0.71c-1.el6.noarch 4/10
Verifying : libyaml-0.1.3-4.el6_6.x86_64 5/10
Verifying : python-pyasn1-0.0.12a-1.el6.noarch 6/10
Verifying : ansible-2.6.20-1.el6.noarch 7/10
Verifying : python-jinja2-26-2.6-3.el6.noarch 8/10
Verifying : python-crypto2.6-2.6.1-2.el6.x86_64 9/10
Verifying : python-httplib2-0.18.1-1.el6.noarch 10/10
Installed:
ansible.noarch 0:2.6.20-1.el6
Dependency Installed:
PyYAML.x86_64 0:3.10-3.1.el6 libyaml.x86_64 0:0.1.3-4.el6_6 python-crypto2.6.x86_64 0:2.6.1-2.el6
python-httplib2.noarch 0:0.18.1-1.el6 python-jinja2-26.noarch 0:2.6-3.el6 python-keyczar.noarch 0:0.71c-1.el6
python-pyasn1.noarch 0:0.0.12a-1.el6 python-six.noarch 0:1.9.0-2.el6 sshpass.x86_64 0:1.06-1.el6
Complete!
[root@ngelinux001 yum.repos.d]#
Now we have installed the ansible package on the system.
And now we can use it to automate the tasks.
The point to note here is the repository contents, its a new path in archive directory as the contents are now moved over there.
