Skip to content

AppliNH/ansible-dev-lab-docker

Repository files navigation

Ansible dev lab with Docker

To start :

docker-compose up --build

Then, inside master container :

  • ssh-agent bash
  • ssh-add /var/ansible_keys/master_key

(Password is 12345)

Check that everything is setup correctly with :

ansible -u ansible -m ping all

Config ansible_workspace

To target a local dir containing your ansible playbook workspace, simply use an env file containing :

ANSIBLE_LAB_WORKSPACE=/absolute/path/to/your/workspace

Be sure that you're using an absolute path

You can switch between your env file when starting the lab with the --env-file argument of the docker-compose CLI, like so :

docker-compose --env-file ./.env.dev up

To make sure that your env file has been loaded correctly, check the compose file that is about to be used to start the lab :

docker-compose --env-file ./.env.dev config

^ There you should see your workspace path appear in the outputted YML config.

About

A quick ansible dev lab using Docker containers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published