This playbook will install Ansible Molecule and any pre-requisites required for use with Docker, as well as Docker itself.
It is designed to be executed on the Ansible Control Node and will make all changes locally.
It is expected to work on Ubuntu 18.xx
onwards up to Ubuntu 22.04
and, potentially, Debian 10
onwards.
Note: does not currently work on Ubuntu 23.04
Requires Ansible to be installed.
Enable systemd for WSL2
Delete any existing Docker config/keys from apt
Install Docker-ce and docker-compose from Docker.com repository
Install Docker Module for Python
Ensure group "docker" exists
Added user to docker group
Group change notification (notify user to run newgrp for group-permissions to take effect)
Install ansible-core and ansible-lint using PIP
Install Molecule pre-reqs
(Python3 and libssl)Install/upgrade setuptools
Install Molecule
Install/upgrade ansible-lint
Install Molecule-Docker
Install Molecule-Docker Driver
Invoke using:
ansible-playbook -K main.yml --tags <ROLENAME>
e.g.
ansible-playbook -K main.yml --tags installer
groupvars/main.yml
contains a mapping lookup for ansible_distribution_file_variety
and ansible_architecture
to construct the correct Docker repository URI.
molecule_driver_cleanup
and docker_cleanup_required
are set to true
by default.
The effect is that the playbook isn't, strictly speaking, fully idempotent.
However, since those tasks ought to be run (according to the docs) and shouldn't break anything if run each time it's more of a technicality.
- Make playbook support additional Operating Systems (e.g. CentOS)
- Break out sub-tasks such as docker_install, ansible_install
-
Create 'Uninstall' role
GPL-3.0-or-later