Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.