All Projects → chrismeyersfsu → Provision_docker

chrismeyersfsu / Provision_docker

Test Ansible roles and playbooks using Docker

Labels

Projects that are alternatives of or similar to Provision docker

Rabbitmq Auth Backend Http
HTTP-based authorisation and authentication for RabbitMQ
Stars: ✭ 194 (-6.28%)
Mutual labels:  makefile
Mytermuxdoc
中文Termux文档
Stars: ✭ 201 (-2.9%)
Mutual labels:  makefile
Alpinewsl
Alpine Linux based WSL distribution. Supports multi-install. Lightest WSL distribution.
Stars: ✭ 203 (-1.93%)
Mutual labels:  makefile
Godev
Golang development tool that supports project bootstrap, live-reload (tests + application), and auto dependency retrieval based on Go Modules
Stars: ✭ 196 (-5.31%)
Mutual labels:  makefile
Nodejs Rpm
node.js rpm spec
Stars: ✭ 199 (-3.86%)
Mutual labels:  makefile
Device brcm rpi2
Stars: ✭ 201 (-2.9%)
Mutual labels:  makefile
Json Schema Spec
The JSON Schema I-D sources
Stars: ✭ 2,441 (+1079.23%)
Mutual labels:  makefile
Docs
Documentation for setting up OpenAPS
Stars: ✭ 204 (-1.45%)
Mutual labels:  makefile
Cheat Sheets
Cheat sheets for various stuff
Stars: ✭ 201 (-2.9%)
Mutual labels:  makefile
Migrating To Cloud Native Application Architectures
《迁移到云原生应用架构》中文版 https://jimmysong.io/migrating-to-cloud-native-application-architectures/
Stars: ✭ 203 (-1.93%)
Mutual labels:  makefile
Getting Started With Knative
Knative入门——构建基于 Kubernetes 的现代化Serverless应用 - https://www.servicemesher.com/getting-started-with-knative/
Stars: ✭ 197 (-4.83%)
Mutual labels:  makefile
Learning Cmake
learning cmake
Stars: ✭ 2,524 (+1119.32%)
Mutual labels:  makefile
Learn You A Haskell
“Learn You a Haskell for Great Good!” by Miran Lipovača
Stars: ✭ 202 (-2.42%)
Mutual labels:  makefile
Spksrc
Cross compilation framework to create native packages for the Synology's NAS
Stars: ✭ 2,446 (+1081.64%)
Mutual labels:  makefile
Docker Makefile
Makefile for building docker repository releases
Stars: ✭ 204 (-1.45%)
Mutual labels:  makefile
Longtasks
Long Task API
Stars: ✭ 193 (-6.76%)
Mutual labels:  makefile
Humandiseaseontology
Repository for the Human Disease Ontology.
Stars: ✭ 200 (-3.38%)
Mutual labels:  makefile
Helmfiles
Comprehensive Distribution of Helmfiles for Kubernetes
Stars: ✭ 205 (-0.97%)
Mutual labels:  makefile
Openwrt Pcap dnsproxy
Pcap_DNSProxy for OpenWrt/LEDE
Stars: ✭ 204 (-1.45%)
Mutual labels:  makefile
Git osx installer
Installer for OS X
Stars: ✭ 202 (-2.42%)
Mutual labels:  makefile

Build Status

provision_docker

An Ansible role to help you test your roles. Automagically create docker containers for each of your inventory hosts. Use your production inventory file to create docker containers for development and test.

blah
Resource Description
Blog post Example provision_docker uses
.travis.yml Example TravisCI
Dockerfiles Curated Docker images with init system (so the service module works) and ssh daemon.
chrismeyers/centos6
chrismeyers/centos7
chrismeyers/ubuntu12.04
ubuntu-upstart:14.04
test/playbook_*.yml
role-install_mongod
role-ansible_deps
role-iptables
Example provision-docker projects and uses.

NEW docker_connection

Works with docker for Mac, VirtualBox, VMware Fusion, docker native. Using docker_connection does not require any routing rules.

# inventory
[robots]
optimus image="chrismeyers/ubuntu12.04"
bumblebee image="ubuntu-upstart:14.04"
# test.yml
- name: Bring up docker containers for docker connection inventory iface
  hosts: localhost
  roles:
    - role: provision_docker
      provision_docker_privileged: true,
      provision_docker_inventory_group: "{{ groups['robots'] }}"
      provision_docker_use_docker_connection: true

- hosts: robots
  tasks:
    - name: "Say hello to my new containers"
      ping:
parameter required default choices comments
provision_docker_image no chrismeyers/centos6 chrismeyers/centos6 chrismeyers/centos7 chrismeyers/ubuntu12.04 ubuntu-upstart:14.04 other Docker image to use when starting the container. The containers listed to the left are special. The init system put back in and ssh is started. This allows for starting/stopping service via the service module as well as ssh.
provision_docker_privileged no true true/false Start Docker container in privileged mode.
provision_docker_inventory_group no List of host names that are in the inventory for which to bring up a Docker container. Note that the Docker image that you wish to bring up should be a hostvar associated with the hostname.
provision_docker_inventory no List of <name, image> pairs for which to bring up a Docker container.
provision_docker_use_docker_connection no false true/false Use docker_connection plugin to connect to Docker containers instead of the default ssh.
provision_docker_network no Some name from available networks as listed with $ docker network ls Specify the network that the Docker container should connect to.
provision_docker_volumes no List of volumes to mount within the container. Use docker CLI-style syntax: /host:/container[:mode].
provision_docker_volumes_from no List of container names or to get volumes from.

Mac OS X + docker-machine + VMware Fusion

sudo /sbin/route -n add -net 172.17.0.0 -netmask 255.255.0.0 -gateway $(docker-machine ip default)

Mac OS X + docker-machine + VirtualBox

provision_docker relies on being able to ssh to containers. Thus, the ip of the container must be accessible (a route must exist). If your using docker toolbox on OS X + virtualbox containers are not routed to the host. Run the below commands to be add a route to the containers in the guest VM.

/usr/sbin/scutil -w State:/Network/Interface/vboxnet0/IPv4 -t 0
sudo /sbin/route -n add -net 172.17.0.0 -netmask 255.255.0.0 -gateway $(docker-machine ip)

The route does not persist across reboots. To persist the changes edit /Library/LaunchDaemons/com.docker.route.plist

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC '-//Apple//DTD PLIST 1.0//EN' 'http://www.apple.com/DTDs/PropertyList-1.0.dtd'>
<plist version='1.0'>
<dict>
  <key>Label</key>
  <string>com.docker.route</string>
  <key>ProgramArguments</key>
  <array>
    <string>bash</string>
    <string>-c</string>
    <!-- You need to adapt the vboxnet0 to the interface that suits your setup, use ifconfig to find it -->
    <string>/usr/sbin/scutil -w State:/Network/Interface/vboxnet0/IPv4 -t 0;sudo /sbin/route -n add -net 172.17.0.0 -netmask 255.255.0.0 -gateway 192.168.99.100</string>
  </array>
  <key>KeepAlive</key>
  <false/>
  <key>RunAtLoad</key>
  <true/>
  <key>LaunchOnlyOnce</key>
  <true/>
</dict>
</plist>

Expose and publish ports

Set expose and ports lists in your inventory per container. Checkout the docker_container Ansible module for reference.

Similar Work

Projects Using provision_docker

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].