Installing Ansible and AWX


Virtxpert

I hope this Ansible post will turn into a series shortly, but every series starts with a first step and that first step is installing the platform to do some POCs.

What is Ansible

For those unfamiliar with Ansible, it is a configuration management platform, along the lines of Puppet or Chef which might be two of the more well known tools.  Ansible is relatively young, just having released version 1.4 on 11/21/13 which included 33 new modules (I hope to get into modules in a future post).  Ansible comes in two versions, a free command line only open source version and AWX, their enterprise platform.  Ansible does provide AWX free for up to 10 managed machines (physical or virtual).  Ansible uses SSH to communicate with the managed machines, no need to install any agents!  Another option that a co-worker found is called Fireball-Mode which uses 0mq (Zero-MQ) to more quickly run playbooks.  Playbooks are something I hope to cover in a future post,  but basically a analogous to cookbooks in Chef or manifests in Puppet.

With that brief intro out of the way, lets start installing!

Ansible Installation

I am going to skip the linux setup steps, so make sure you have a linux server to install this on.  This example will review installing on CentOS 6.4.  First we will install Ansible OSS, later AWX will sit on top of the Ansible install to provide the GUI/Management features such as role based access control.

First, we need to add an additional YUM repository as it is not part of the defaults.  The easiest way to do this is:

yum install http://mirror.oss.ou.edu/epel/6/i386/epel-release-6-8.noarch.rpm

Next, its a simple

yum install ansible

Yum as you would expect installs all the dependencies for Ansible to work, mostly Python packages.  At this point Ansible is installed, if you type Ansible in your shell you will see a list of the options available

ansibleoptions

Installing AWX is not to hard, however there was a step missed in the official AWX user guide that is not included in Anisble OSS:

yum install libselinux-python

Now that we have that package installed download AWX (if you dont have WGET in your VM, yum install wget) and extract

wget http://ansibleworks.com/releases/awx/setup/awx-setup-latest.tar.gz

tar -zxvf awx-setup-latest.tar.gz

At this point you could install, and Ansible would come up with the default username and password of admin / password but I would suggest edit /group_vars/all to change the admin password because you probably want to change the httpd server alias in this file anyways to have a valid hostname for your install, so

vi /awx-setup-ver#/group_vars/all

The ver# will change, when I wrote this it was 1.3.1, and as I mentioned above 1.4 was just released.  Now that you have everything installed, you can run

/awx-setup-ver$/setup.sh

or ./setup.sh if you are in that folder.  The install will start and being configuring all the various components.  Once complete you should be able to head to your servers IP address (no special ports needed) and log into AWX.

ansible

emptyansible

 

Summary

In this post, we reviewed the basics for getting Ansible installed so you can log into the web interface.  In the next post I am going to review the hierarchy of Ansible.  One of my goals is to see if Ansible can be used with ESXi to do configuration management.  In its current state it does not work with the vMA because of the state change of the shell once you log into vCenter but wondering if it will work connecting directly to an ESXi host via SSH.

Installing Ansible and AWX