Public | Automated Build

Last pushed: 3 months ago
Short Description
Ansible control machine as a container
Full Description

Docker image for Ansible.

To run an Ansible playbook using this container, run the following:

$ docker run -it --rm cultureamp/docker-ansible:latest -v $PWD:/usr/src/myapp ansible-playbook <path_to_playbook>

This command will automatically mount the current working directory into the /usr/src/myapp folder inside the container.

Running playbooks against AWS

To run a playbook that interacts with AWS, the following command line arguments should be used in order for your temporary credentials to be available inside the container:

$ docker run -it --rm cultureamp/docker-ansible:latest -v $PWD:/usr/src/myapp \
            -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
            -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
            -e AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION \
            -e AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN \
            -e AWS_SECURITY_TOKEN=$AWS_SECURITY_TOKEN \
       ansible-playbook <path_to_playbook>

Notes:

  • Run docker pull cultureamp/docker-ansible:latest if the image is not present locally.
  • use aws-vault to set your AWS credentials.
Docker Pull Command
Owner
cultureamp
Source Repository