Ansible Docker Image with SSH access

For an ansible course I had to teach, I was missing the option to quickly spin up a few machines for each student.

I wanted at least 2 linux machines with ansible installed.  1 as the ansible host and the other as ansible test destination.

There are ubuntu images with ansible pre-installed, but they don't have SSH access enabled.  Seems that's a bit of a struggle, since the SSH server needs to be setup, hence a user is needed.  And for testing the `become` feature, we needed sudo as well.

So I created this docker-compose project, that deploys 1 or more ubuntu machines with SSH enabled and ansible pre-installed. 

Once you followed the procedure, you will have at least 2 containers listening for SSH on respectavely 2201 and 2202 with a default user and password.

Post a Comment