Installing Ansible

The Problem

Need to deploy an Ansible Controller to run Playbooks from that uses the latest build and is easy to upgrade/configure.

The Solution

Install Ansible from the latest release on GitHub.

The Goal

Create an Ansible Controller directory that will run the latest version via git clone and setup the shell with the Ansible environment scripts.


Clone the Ansible repo

Go to the GitHub project page github/ansible

Choose a release version or the dev branch and clone.

sandor@theargo:$ mkdir ~/Codestuff/AnsibleController <-- Ansible runs from here
sandor@theargo:$ mkdir ~/Codestuff/ansibles <-- Playbooks go here
sandor@theargo:$ touch ~/Codestuff/ansibles/ansible_hosts <-- Server inventory goes here
sandor@theargo:$ cd ~/Codestuff/AnsibleController
sandor@theargo:$ git clone git@github.com:ansible/ansible.git

Run the environment script

sandor@theargo:$ ./hacking/env-setup

To upgrade Ansible just go back into the AnsibleController directory and use git to get the latest.

You are now setup to run Ansible from the Controller. Because the inventory file is inside the playbook dir or ~/Codestuff/ansibles/ansible_hosts it will not get overwritten if you change the AnsibleController dir.

Push some SSH public keys and start pushing playbooks!