Skip to content

Instantly share code, notes, and snippets.

@JacobCallahan
Last active May 20, 2018 20:03
Show Gist options
  • Save JacobCallahan/3e510dbc6d6a39404a6ab0ef0253e1ac to your computer and use it in GitHub Desktop.
Save JacobCallahan/3e510dbc6d6a39404a6ab0ef0253e1ac to your computer and use it in GitHub Desktop.
Ansible playbook to setup a RHEL 7.4 docker image. Also provides flood.py script
---
# This playbook will setup a docker-ized content host deployment
# environment on the target system(s).
# After completion, a RHEL 7.4 docker image will be available
# and the git repo will be located at /root/content-host-d
- hosts: beaker
remote_user: root
tasks:
- name: Install Docker
package: name=docker state=latest
- service: name=docker state=started enabled=yes
- name: Install python pip
easy_install: name=pip
- name: Install docker-py
pip: name=docker-py state=latest
- name: Install git
package: name=git state=present
- name: Clone content host repo
git:
repo : https://github.com/JacobCallahan/content-host-d.git
version : rhel74
dest : /root/content-host-d
- name: Build RHEL 7.4 content host image
docker_image:
path: /root/content-host-d
name: ch-d
tag: rhel74
@JacobCallahan
Copy link
Author

note that selinux can interfere with running docker containers. make sure your environment is setup appropriately to allow docker to run containers. definitely don't just setenforce 0 before running this playbook! ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment