All Projects → walokra → Docker Ansible Playbook

walokra / Docker Ansible Playbook

Docker Image of Ansible for executing ansible-playbook command against an externally mounted set of Ansible playbooks

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Docker Ansible Playbook

Mongo Seeding
The ultimate solution for populating your MongoDB database.
Stars: ✭ 375 (+316.67%)
Mutual labels:  hacktoberfest, docker-image
Jenkinsfile Runner
A command line tool to run Jenkinsfile as a function
Stars: ✭ 727 (+707.78%)
Mutual labels:  hacktoberfest, docker-image
Trashemail
A hosted disposable email telegram bot; Extremely privacy friendly; Proudly hosted for community.
Stars: ✭ 408 (+353.33%)
Mutual labels:  hacktoberfest, docker-image
Portainer
Making Docker and Kubernetes management easy.
Stars: ✭ 20,434 (+22604.44%)
Mutual labels:  hacktoberfest, docker-image
Ansible Mariadb Galera Cluster
Stars: ✭ 49 (-45.56%)
Mutual labels:  hacktoberfest, ansible
Docker Inbound Agent
Docker image for a Jenkins agent which can connect to Jenkins using TCP or Websocket protocols
Stars: ✭ 342 (+280%)
Mutual labels:  hacktoberfest, docker-image
Phansible
Phansible - generate Vagrant + Ansible dev environments for PHP
Stars: ✭ 633 (+603.33%)
Mutual labels:  hacktoberfest, ansible
Docker Build With Cache Action
Build and push docker images caching each stage to reduce build time
Stars: ✭ 228 (+153.33%)
Mutual labels:  hacktoberfest, docker-image
Postgresql Postgis Timescaledb
PostgreSQL + PostGIS + TimescaleDB docker image 🐘🌎📈
Stars: ✭ 19 (-78.89%)
Mutual labels:  hacktoberfest, docker-image
Metasfresh
We do Open Source ERP - Fast, Flexible & Free Software to scale your Business.
Stars: ✭ 807 (+796.67%)
Mutual labels:  hacktoberfest, docker-image
Openjdk Docker
Scripts for creating Docker images of OpenJDK binaries.
Stars: ✭ 299 (+232.22%)
Mutual labels:  hacktoberfest, docker-image
Custom War Packager
Custom Jenkins WAR packager for Jenkins
Stars: ✭ 77 (-14.44%)
Mutual labels:  hacktoberfest, docker-image
Molecule
Molecule aids in the development and testing of Ansible roles
Stars: ✭ 3,262 (+3524.44%)
Mutual labels:  hacktoberfest, ansible
Devops Guide
DevOps Guide - Development to Production all configurations with basic notes to debug efficiently.
Stars: ✭ 4,119 (+4476.67%)
Mutual labels:  hacktoberfest, ansible
Yii2 Docker
Official Docker images suitable for Yii 2.0
Stars: ✭ 286 (+217.78%)
Mutual labels:  hacktoberfest, docker-image
Apisprout
Lightweight, blazing fast, cross-platform OpenAPI 3 mock server with validation
Stars: ✭ 519 (+476.67%)
Mutual labels:  hacktoberfest, docker-image
Community.kubernetes
Kubernetes Collection for Ansible
Stars: ✭ 214 (+137.78%)
Mutual labels:  hacktoberfest, ansible
Awesome Ansible
Awesome Ansible List
Stars: ✭ 215 (+138.89%)
Mutual labels:  hacktoberfest, ansible
Configuration
A collection of edx configuration scripts and utilities that edx.org uses to deploy openedx.
Stars: ✭ 776 (+762.22%)
Mutual labels:  hacktoberfest, ansible
Molecule Vagrant
Molecule Vangrant Driver
Stars: ✭ 69 (-23.33%)
Mutual labels:  hacktoberfest, ansible

Ansible Playbook Docker Image

Docker Image of Ansible for executing ansible-playbook command against an externally mounted set of Ansible playbooks. Based on philm/ansible_playbook

Build

docker build -t walokra/ansible-playbook .

Test

$ docker run --name ansible-playbook --rm walokra/ansible-playbook --version

ansible-playbook 2.3.0.0
  config file =
  configured module search path = [u'/opt/ansible/library']
  python version = 2.7.13 (default, Apr 20 2017, 12:13:37) [GCC 6.3.0]

Running Ansible Playbook

docker run --rm -it -v PATH_TO_LOCAL_PLAYBOOKS_DIR:/ansible/playbooks walokra/ansible-playbook PLAYBOOK_FILE

For example, assuming your project's structure follows best practices, the command to run ansible-playbook from the top-level directory would look like:

docker run --rm -it -v $(pwd):/ansible/playbooks walokra/ansible-playbook site.yml

Ansible playbook variables can simply be added after the playbook name.

Ansible Helper wrapper

Shell script named ansible_helper that wraps a Docker image containing Ansible:

docker run --rm -it \
  -v ~/.ssh/id_rsa:/root/.ssh/id_rsa \
  -v ~/.ssh/id_rsa.pub:/root/.ssh/id_rsa.pub \
  -v $(pwd):/ansible/playbooks \
  -v /var/log/ansible/ansible.log \
  walokra/ansible-playbook "[email protected]"

Point the above script to any inventory file so that we can execute any Ansible command on any host, e.g.

./ansible_helper play playbooks/create_user.yml -i inventory/staging -e 'some_var=some_value'

SSH Keys

If Ansible is interacting with external machines, you'll need to mount an SSH key pair for the duration of the play:

docker run --rm -it \
    -v ~/.ssh/id_rsa:/root/.ssh/id_rsa \
    -v ~/.ssh/id_rsa.pub:/root/.ssh/id_rsa.pub \
    -v $(pwd):/ansible/playbooks \
    walokra/ansible-playbook site.yml

Ansible Vault

If you've encrypted any data using Ansible Vault, you can decrypt during a play by either passing --ask-vault-pass after the playbook name, or pointing to a password file. For the latter, you can mount an external file:

docker run --rm -it -v $(pwd):/ansible/playbooks \
    -v ~/.vault_pass.txt:/root/.vault_pass.txt \
    walokra/ansible-playbook \
    site.yml --vault-password-file /root/.vault_pass.txt

Note: the Ansible Vault executable is embedded in this image. To use it, specify a different entrypoint:

docker run --rm -it -v $(pwd):/ansible/playbooks --entrypoint ansible-vault \
  walokra/ansible-playbook encrypt FILENAME
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].