The control node installation

First, let's clarify the terminology we will use in the context of Ansible. We will refer to the virtual machine with Ansible installed as the control machine, and the machines being managed as the target machines or managed nodes. Ansible can be installed on most of the Unix systems, with the only dependency of Python 2.6 or 2.7. Currently, the Windows operating system is not officially supported as the control machine. Windows hosts can still be managed by Ansible, as they are just not supported as the control machine.

As Windows 10 starts to adopt the Windows Subsystem for Linux, Ansible might soon be ready to run on Windows as well. For more information, please check the Ansible documentation for Windows (https://docs.ansible.com/ansible/2.4/intro_windows.html). 

On the managed node requirements, you may notice some documentation mentioning that Python 2.4 or later is a requirement. This is true for managing target nodes with operating systems such as Linux, but obviously not all network equipment supports Python. We will see how this requirement is bypassed for networking modules by local execution on the control node.

For Windows, Ansible modules are implemented in PowerShell. Windows modules in the core and extra repository live in a Windows/subdirectory if you would like to take a look. 

We will be installing Ansible on our Ubuntu virtual machine. For instructions on installation on other operating systems, check out the installation documentation (http://docs.ansible.com/ansible/intro_installation.html). In the following code block, you will see the steps for installing the software packages:

$ sudo apt-get install software-properties-common
$ sudo apt-add-repository ppa:ansible/ansible
$ sudo apt-get update
$ sudo apt-get install ansible
We can also use pip to install Ansible: pip install ansible. My personal preference is to use the operating system's package management system, such as Apt on Ubuntu. 

We can now do a quick verification as follows:

$ ansible --version
ansible 2.6.1
config file = /etc/ansible/ansible.cfg

Now, let's see how we can run different versions of Ansible on the same control node. This is a useful feature to adopt if you'd like to try out the latest development features without permanent installation. We can also use this method if we intend on running Ansible on a control node for which we do not have root permissions. 

As we saw from the output, at the time of writing this book, the latest release is 2.6.1. Feel free to use this version, but given the relatively new release, we will focus on Ansible version 2.2 in this book.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset