Skip to content

Instantly share code, notes, and snippets.

@russmckendrick
Created September 24, 2017 13:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save russmckendrick/36d3f131cae273e6c85060a8d172a195 to your computer and use it in GitHub Desktop.
Save russmckendrick/36d3f131cae273e6c85060a8d172a195 to your computer and use it in GitHub Desktop.
AWX
- name: Deploy AWX
hosts: all
become: true
become_user: root
tasks:
- name: sort out the yum repos
yum:
name: "{{ item }}"
state: "latest"
with_items:
- "epel-release"
- "yum-utils"
- name: add the docker ce yum repo
yum_repository:
name: "docker-ce"
description: "Docker CE YUM repo"
gpgcheck: "yes"
enabled: "yes"
baseurl: "https://download.docker.com/linux/centos/7/$basearch/stable"
gpgkey: "https://download.docker.com/linux/centos/gpg"
- name: install the prerequisites using yum
yum:
name: "{{ item }}"
state: "latest"
with_items:
- "epel-release"
- "libselinux-python"
- "python-wheel"
- "python-pip"
- "git"
- "docker-ce"
- name: start and enable docker
systemd:
name: "docker"
enabled: "yes"
state: "started"
- name: install the python packages using pip
pip:
name: "{{ item }}"
state: "latest"
with_items:
- "pip"
- "ansible"
- "boto"
- "boto3"
- "docker"
- name: check out the awx repo
git:
repo: "https://github.com/ansible/awx.git"
dest: "~/awx"
clone: "yes"
update: "yes"
- name: install awx
command: "ansible-playbook -i inventory install.yml"
args:
chdir: "~/awx/installer"
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "centos/7"
config.vm.provider :virtualbox do |v|
v.memory = 4048
v.cpus = 2
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--ioapic", "on"]
end
config.vm.define "awx" do |awx|
awx.vm.hostname = "awx.local"
awx.vm.network :forwarded_port, guest: "80", host: "8080"
awx.vm.provision :ansible do |ansible|
ansible.playbook = "playbook.yml"
ansible.become = true
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment