Skip to content

Docker container for creating a basic control node to execute ansible-playbook

License

Notifications You must be signed in to change notification settings

isometimescode/docker-ansible-playbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ansible Playbook

This installs Ansible in a basic Debian Bullseye Python 3.10 image.

Usage Examples

  • Grab the image from DockerHub
docker pull isometimescode/ansible-playbook:latest
  • Grab a specific version of Ansible from DockerHub
docker pull isometimescode/ansible-playbook:2.10.3
  • Run a container and check the installed version of ansible
docker run -t --rm -v $(pwd)/my-local-playbook:/playbook isometimescode/ansible-playbook --version
  • Run a container and mount a volume with your playbook contents to execute a play
docker run -it --rm -v $(pwd)/my-local-playbook:/playbook isometimescode/ansible-playbook /playbook/main.yml

Building Your Own Image

Build Arguments Default Value
ANSIBLE_VERSION 6.0.0
PLAYBOOK_DIR /playbook

The environment variable ANSIBLE_CONFIG is set with the default value of $PLAYBOOK_DIR/ansible.cfg e.g. /playbook/ansible.cfg.

For example, you can build a new image with a specific version of ansible:

docker build . -t ansible-playbook:2.9.13 --build-arg ANSIBLE_VERSION=2.9.13

About

Docker container for creating a basic control node to execute ansible-playbook

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages