-
Notifications
You must be signed in to change notification settings - Fork 326
Description
Your setup
Formula commit hash / release tag
https://github.com/saltstack-formulas/docker-formula/releases/tag/v1.1.1
Versions reports (master & minion)
master
# salt --versions-report
Salt Version:
Salt: 3002.2
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.5.3
docker-py: Not Installed
gitdb: 2.0.0
gitpython: 2.1.1
Jinja2: 2.9.4
libgit2: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 0.6.2
msgpack-pure: Not Installed
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: Not Installed
pycryptodome: 3.6.1
pygit2: Not Installed
Python: 3.5.3 (default, Jul 9 2020, 13:00:10)
python-gnupg: Not Installed
PyYAML: 3.12
PyZMQ: 17.1.2
smmap: 2.0.1
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.2.1
System Versions:
dist: debian 9 stretch
locale: UTF-8
machine: x86_64
release: 4.9.0-13-amd64
system: Linux
version: Debian GNU/Linux 9 stretchminion
# salt-minion --version-report
Salt Version:
Salt: 3002.5
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.6.1
docker-py: 4.4.4
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 2.10.1
libgit2: Not Installed
M2Crypto: 0.35.2
Mako: Not Installed
msgpack: 0.6.2
msgpack-pure: Not Installed
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: Not Installed
pycryptodome: Not Installed
pygit2: Not Installed
Python: 3.6.8 (default, Aug 24 2020, 17:57:11)
python-gnupg: Not Installed
PyYAML: 3.12
PyZMQ: 19.0.0
smmap: Not Installed
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.3.4
System Versions:
dist: centos 8 n/a
locale: UTF-8
machine: x86_64
release: 4.18.0-240.1.1.el8_3.x86_64
system: Linux
version: CentOS Linux 8 n/aPillar / config used
docker:
pkg:
docker:
use_upstream: repoBug details
Describe the bug
Default service name in current official docker packages for CentOS / Debian is docker not dockerd but formula default is dockerd.
docker-formula/docker/defaults.yaml
Lines 40 to 43 in 8835a9f
| name: docker-ce | |
| service: | |
| name: dockerd | |
| env: null |
On CentOS default service status after package installed is Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
As a result service is not started, not enabled after formula applied.
On Debian 10 default service status after package installed is Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Therefore this issue can be missed while using formula with Debian.
Also although service dockerd is clearly missing formula fails silently due unnecessary onlyif condition
| - onlyif: systemctl list-unit-files | grep {{ d.pkg.docker.service.name }} >/dev/null 2>&1 |
It is not clear why this condition is added in general. It's only masking issues like this.
Steps to reproduce the bug
On CentOS 8
# install docker with formula using upstream repository
# docker:pkg:docker:use_upstream: repo
$ salt 'minion-centos8' state.sls docker
# check service
$ salt 'minion-centos8' service.missing docker
minion-centos8:
False
$ salt 'minion-centos8' service.missing dockerd
minion-centos8:
TrueExpected behaviour
After formula is applied to the minion, docker service is running and operational.
Attempts to fix the bug
Issue can be fixed locally by adding correct service name to pillars
docker:
pkg:
docker:
use_upstream: repo
service:
name: dockerBut defaults must be fixed too.
Additional context
I think this change can be considered as BREAKING. After this change duplicate service will be created on systems where archive method is used. Therefor I'm creating issue to discuss.