Comments (8)
Stupid me confussed systemctl reload
with systemctl daemon-reload
and got confussed by the fact that there is no restart of docker
itself.
Thanks for correcting me!
from ansible-role-docker.
For me that's still the case. My workaround is specifying all configuration paramaters in the daemon.json
via:
docker_daemon_options:
containerd: "/run/containerd/containerd.sock"
hosts: [
"tcp://127.0.0.1:2375",
"unix:///var/run/docker.sock"
]
and the following systemd override via a pre_tasks
for now:
pre_tasks:
- name: Docker - override systemd service unit
copy:
dest: '/etc/systemd/system/docker.service.d/override.conf'
content: |
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd
from ansible-role-docker.
thanks @sepek for your solution. I've added some more lines into yours to make a little bit more generic and avoid some errors
pre_tasks: # see: https://github.com/geerlingguy/ansible-role-docker/issues/411
- name: Docker - make sure systemd dir exists
ansible.builtin.file:
path: /etc/systemd/system/docker.service.d
state: directory
mode: '0755'
owner: root
group: root
- name: Docker - override systemd service unit
copy:
dest: '/etc/systemd/system/docker.service.d/override.conf'
content: |
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd
mode: '0755'
owner: root
group: root
register: systemd_changed
- name: Just force systemd to reread configs
ansible.builtin.systemd:
daemon_reload: true
when: systemd_changed.changed
hope it helps
from ansible-role-docker.
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!
Please read this blog post to see the reasons why I mark issues as stale.
from ansible-role-docker.
@epou Nice thanks! I guess you would need a restart instead of a reload of Docker. Else I suspect the process would still be running with the default parameters.
from ansible-role-docker.
This is what I got without the systemctl daemon-reload
>>> sudo systemctl status docker.service
Warning: The unit file, source configuration file or drop-ins of docker.service changed on disk. Run 'systemctl daemon-reload' to reload units.
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2023-10-05 13:37:10 UTC; 13s ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Process: 3095311 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 3095311 (code=exited, status=1/FAILURE)
CPU: 32ms
Oct 05 13:37:08 hostname systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Oct 05 13:37:08 hostname systemd[1]: docker.service: Failed with result 'exit-code'.
Oct 05 13:37:08 hostname systemd[1]: Failed to start Docker Application Container Engine.
Oct 05 13:37:10 hostname systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Oct 05 13:37:10 hostname systemd[1]: Stopped Docker Application Container Engine.
Oct 05 13:37:10 hostname systemd[1]: docker.service: Start request repeated too quickly.
Oct 05 13:37:10 hostname systemd[1]: docker.service: Failed with result 'exit-code'.
Oct 05 13:37:10 hostname systemd[1]: Failed to start Docker Application Container Engine.
So I saw the -> Run 'systemctl daemon-reload' to reload units.
So then:
>>> sudo systemctl daemon-reload
>>> sudo systemctl start docker.service
>>> sudo systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/docker.service.d
└─override.conf
Active: active (running) since Thu 2023-10-05 13:38:00 UTC; 1s ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Main PID: 3095351 (dockerd)
Tasks: 10
Memory: 34.0M
CPU: 203ms
CGroup: /system.slice/docker.service
└─3095351 /usr/bin/dockerd
It can be seen that the override is done well.
from ansible-role-docker.
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!
Please read this blog post to see the reasons why I mark issues as stale.
from ansible-role-docker.
This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.
from ansible-role-docker.
Related Issues (20)
- Debian: add `signed-by` param to the apt list HOT 3
- Option to install rootless HOT 4
- Molecule support in GitLab CI HOT 3
- Unable to install a specific version of docker on ubuntu HOT 6
- Run playbook HOT 1
- Idempotence test failed HOT 3
- feature: use ansible facts HOT 3
- Amazon Linux 2023 support HOT 1
- docker-compose-plugin install fails on arch HOT 6
- geerlingguy.docker was NOT installed successfully HOT 4
- error in first run during check if there are any users to add to docker group HOT 2
- Failure when adding docker repository HOT 6
- GPG keys should not be saved to `/apt/trusted.gpg.d` / Do not use `apt-key` HOT 2
- Playbook Fails with error when uninstalling HOT 2
- Reload system config at start HOT 1
- ansible.builtin.include has been removed Error while installing docker role HOT 1
- no /etc/docker/daemon.json ? HOT 1
- Fix min_ansible_version type HOT 1
- Update docker version HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-role-docker.