I recently purchased the Udemy Mastering Ansible Course. The course instructor mentions that he is using a Docker environment for the exercises, however I wasn't able to find a copy of this configuration to use. While there is a Vagrant file provided, I'd prefer not to install VMware Fusion or VirtualBox if I can avoid it and already have Docker for macOS installed.
The topology of the course, provided by the instructor, is included in the Topology.pdf file within this repository.
To make use of this repository you'll need the following software.
- macOS 10.13.5
- Docker for macOS 18.05+
Note: I have only tested this on the Mac, but believe it should also work on a Linux system. For my Windows friends you may need to make modifications to the Dockerfile in the control and base directories. I don't have access to a Windows system to test.
-
Clone the repository to your machine
-
Install Docker for macOS, if you haven't already
-
Start Docker for macOS so that it is running
-
Open a terminal session and change to the directory on your machine where you cloned the repository
-
Build and start the environment:
docker-compose up --build -d
-
Connect to the Control Machine container
docker container exec -it udemy-mastering-ansible_control_1 bash
-
Verify the Control Machine container is able to communicate with the Managed Node containers
ansible all -m ping
Note: the ansible
directory on your host will be mounted to the Control Machine container under /var/ansible
. Any changes you make on your host to the ansible
directory will show up in your Control Machine container. This allows you to use a text editor, like Atom, to write your Ansible configuration on the host machine and run it in the Control Machine container without losing it once the containers are shutdown.
docker-compose up --build -d
docker container exec -it udemy-mastering-ansible_control_1 bash
docker-compose down --remove-orphan
git pull
Note: This should not change any of your files in the ansible/ directory within your clone of this project.
If you find a bug, something that needs to be corrected, or a possible enhancement, please create an issue or better yet submit the fix through a Pull Request.