install_base fails if a very old Docker version is already present
Summary
After running the install_base
action on hosts with Docker 1.11.2, the docker
system service fails and cannot be started any more.
Steps to reproduce
Run install_base
on a host with Docker 1.11.2.
Expected behavior
Either nothing happens, or Docker gets reconfigured to match the requested settings.
Actual behavior
The docker
service fails miserably and cannot be started.
Relevant logs and/or screenshots
The problem lies in the configuration file generated by Ansible, i.e. /etc/systemd/system/docker.service.d/settings.conf
:
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd --mtu=1450
Very old Docker installations do not have the dockerd
binary and instead use /usr/bin/docker daemon
.
Possible fixes
Dunno. Maybe just automatically update Docker to current version?
Also, the fix should work with other Docker configuration files already present in the system, such as this one:
[Service]
MountFlags=shared
EnvironmentFile=/etc/sysconfig/docker
# It's necessary to clear ExecStart before attempting to override it
# or systemd will complain that it is defined more than once.
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// $other_args