Skip to content

Instantly share code, notes, and snippets.

@include
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save include/1dcc716a5989fff3e910 to your computer and use it in GitHub Desktop.
Save include/1dcc716a5989fff3e910 to your computer and use it in GitHub Desktop.
setup ansible plus tower
- hosts: ansible
sudo: yes
roles:
- { role: include.amzn-base }
vars:
ansible_version: 1.7.1
ansible_tower_version: 2.0.0
ansible_pkgs:
- python-pip
- python-paramiko
- PyYAML
- python-jinja2
- python-httplib2
- python-pyasn1
- rpm-build
- make
- python2-devel
ansible_epel_pkgs:
- python-crypto2.6
- python-keyczar
- sshpass
tasks:
- name: install ansible packages
yum: pkg={{ item }} state=latest
with_items: ansible_pkgs
tags: pkgs
- name: install ansible epel packages
yum: pkg={{ item }} enablerepo=epel state=latest
with_items: ansible_epel_pkgs
tags:
- pkgs
- epelpkgs
- name: clone ansible git repo
git: repo=https://github.com/ansible/ansible.git
dest=/opt/ansible-{{ ansible_version }}
version=release{{ ansible_version }}
tags: gitclone
- name: link /opt/ansible to /opt/ansible-{{ansible_version }}
file: src=/opt/ansible-{{ ansible_version}} dest=/opt/ansible state=link
tags: link
- name: upload and extract pre-fetched tower to remote host
unarchive: src=~/Downloads/ansible-tower-setup-latest.gz dest=/opt
tags: extract
- name: build rpm
command: chdir=/opt/ansible make rpm
tags: rpm
- name: install rpm
command: chdir=/opt/ansible rpm -Uvh rpm-build/ansible-{{ ansible_version }}*.noarch.rpm
tags: rpm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment