Installing Ansible
In this recipe, we'll set up an Ansible control server and demonstrate some basic Ansible commands. We'll run some basic commands using Ansible to gain an understanding of the fundamentals.
Getting ready
In order to complete this recipe, you'll need a Python 2.7 development environment. For the purposes of this recipe, we used Ubuntu 16.04, which ships by default with Python 3 out of the box, but Python 2.7 is also available from the Ubuntu repositories.
How to do it...
We're going to install Ansible on our management host and then use it to connect to itself to test basic Ansible commands.
- First of all, we're going to install Python 2.7, since it may not be installed as the default Python interpreter in Ubuntu 16.04:
ubuntu@ubuntu-xenial:~$sudo apt-get install -y python2.7 python-pip
- Then, we'll install Ansible using the Python package manager:
ubuntu@ubuntu-xenial:~$ pip install ansible Collecting ansible [...] Successfully built ansible pycrypto Installing...