How to install ansible on CentOS 7 system

Starting from a minimal CentOS installation, following I share the steps I did for ansible installation:

1) System update
# yum -y update
# init 6

2) Epel repository configuration and ansible pkg installation
# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# rpm -ivh epel-release-latest-7.noarch.rpm
# yum -y install ansible vim

3)In my case I’m using ansible for working on Vmware ESX environment so I also installed a python module:
# yum install python-pip
# pip install --upgrade pip
# pip install pyVmomi
# pip install --upgrade pyVmomi

4) On a user home directory I created .ansible.cfg for any local customization
$ touch .ansible.cfg
$ ansible --version
ansible 2.0.1.0
config file = /home/alex/.ansible.cfg
...output omitted...

5) On the same directory I created a .vimrc file automating the yaml indent spaces
$ cat .vimrc
autocmd FileType yaml setlocal ai ts=2 sw=2 et

Ansible now is ready to fire! šŸ˜€

Advertisements