Docker and Ansible Part 1

Docker and Ansible

This story is mainly focused Docker with Ansible. I like using Docker in the first place is that it is a pretty light platform to spin up and run or just test and play around with. As you can see in this post my resources are limited.

Setup and install

To use this repo we need a host system with some basic developer and virtualisation tools installed. I have grown into the habbit of not installing to much things I am testing on my development machine for this reason I will use just a virtual machine in virtualbox on which I can install Ansible and run my code base. If you are familiatr with using Git Vagrant and virtualbox you can skip these installation steps probably. Another advantage for this way of working is that I can version pinn in my code base which OS and verions of tools to use.

Download the github repo

Install Git on your system brew install git or sudo apt-get install git or download it here Download the repo git clone [email protected]:roelsieg/ansiblynology.git. The repo you may have just downloaded has the following setup:

  │   ├──role_1
  │   └──role_2

Download vagrant and virtualbox

Install vagrant on your system brew cask install vagrant or sudo apt-get install vagrant or download it here

Install virtualbox on your system brew cask install vagrant or sudo apt-get install VirtualBox-6.1 or download it here

Starting your development machine

In a console just type in the root directory of the downloaded repo type vagrant up. This will download and install a Ubuntu Linux machine with Ansible. After it is downloaded the script is started to take care of the Ansible installation. (Credits for the install script mainly go to Ivan Pepelnjak form

Once the Ansible machine is up and running you can login by using vagrant ssh ansible