Cause during installation it's using yum-config-manager, and if it's not
installed it fails with:
yum-config-manager: command not found
Change-Id: I68868e97c7e3b4fb99e286652b9864539afba264
Only update apt-cache when needed
Instead of always updating the apt cache, leverage the 'update_cache'
method during the apt install task. Prior to this patch, every run of
this role resulted in a "changed" state. This patch will clean up that
report to only be "changed" when this actually did indeed change (as
updating the apt-cache isn't a meaningful "change").
use apt_repository instead of file copy
Instead of always updating the apt cache, leverage the 'update_cache'
method during the apt install task. Prior to this patch, every run of
this role resulted in a "changed" state. This patch will clean up that
report to only be "changed" when this actually did indeed change (as
updating the apt-cache isn't a meaningful "change").
Some systems come with the /usr/lib/systemd/system directory. Some
others don't.
Ensuring with this commit that we always have this directory present,
otherwise the placing of the Docker unit file may fail and, in
consequence, the rest of the play.
----------------------------
1. Added some vars to defaults so that the end user can decide whether to use vagrant and docker-py
1. Updated syntax on tasks to follow `key: value` instead of `key=value` format, to make it easier
to track changes
1. Using an explicit become in the handler, since the task may not be run by root
Otherwise, when using this role in combination with some other calls to
Docker right after, the calls would fail as the handlers hadn't yet
kicked it and Docker wouldn't be running by then.