haxorof/ansible-role-docker-ce

Review code around Docker plugin handling

haxorof opened this issue · 1 comments

The handling of Docker plugins was to start with a best effort implementation. This code might include unnecessary when conditions etc which maybe not is necessary and pointed out by @janorn in the last comments in #131.

when: (
ansible_facts.services['docker'] is defined and
ansible_facts.services['docker'].state is defined and
ansible_facts.services['docker'].state != "running"
) or
(
ansible_facts.services['docker.service'] is defined and
ansible_facts.services['docker.service'].state is defined and
ansible_facts.services['docker.service'].state != "running"
)

After looking into what I previously did is that the reason for having these when conditions was to avoid unnecessary restarts of the docker daemon. I think now it is better to remove them completely to make the code easier even if that cause additional restart even when nothing is changed. This happens because initial configuration must be present without the authz plugin configured for the first time during installation since it first needs to be installed via Docker daemon.