-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Centos8: Issues when trying to install plugins #131
Comments
I can't see any harm in just dropping the when statement. Docker needs to be running to install plugins. |
Did you do similar to what I did here in my test? https://github.com/haxorof/ansible-role-docker-ce/blob/master/tests/experimental/cis/test_cis.yml It is a bit complicated when installing the authz and have this special logic around it when you for example install Docker for the first time because then I need to start Docker first without the authz config to be able to download it via the Docker daemon. The after that I can configure it and do a restart. I can try running this test again this weekend and see if that still works. |
I been running with this plugin all the time. But it seems i haven't stumbled on this in my current systems as they already have a running docker. The new check actually doesn't work properly in systemd environments due to the added suffix ".service" in the ansible_facts.services. |
Thanks! I will look into this weekend then. |
Just as note to this issue. Changes related to #127 caused this bug. |
Why do we need this code:
When we need the docker daemon to run to install plugins? This code is only called if there is plugins to be installed: ansible-role-docker-ce/tasks/configure-docker.yml Lines 132 to 134 in 889da07
As ansible service is idempotent. Nothing will happen if the service is already running.
|
The issue with the plugins is that it needs a Docker daemon to be run with a working configuration for the plugins to be installed. Then different Linux distributions behaves differently (or did in the past) when just enabling the service (not starting it): ansible-role-docker-ce/tasks/configure-docker.yml Lines 113 to 119 in 889da07
When you the first install the authz plugin then you are not allowed to have that configuration in
At that time I did that I could not find a better way to do this reconfiguring and restarting all because the Docker daemon itself must be installed to download plugins. |
The when clauses only limits the service module from starting the service if it isn't running. However the service module is idempotent and will not restart the service if it is running. So it would be safe to drop the when clauses. It should behave exactly the same. Hence we really don't need the when clause. If we came this far we want the daemon to be running to be able to install the plugins in the following tasks. Or am I missing something in this particular task file? |
Might be that you are not missing something 😄 |
Version Information
Ansible:
2.9.14
Role:
3.1.1
Steps to Reproduce
Install docker with the following variable set.
Expected Behavior
Install complete and docker running.
Actual Behavior
This seems to be caused by this:
References
ansible-role-docker-ce/tasks/configure-docker/configure-docker-plugins.yml
Lines 4 to 12 in 9aa3a95
The text was updated successfully, but these errors were encountered: