ansible-role-docker icon indicating copy to clipboard operation
ansible-role-docker copied to clipboard

Deamon requires restart when configuring docker_daemon_options

Open boite opened this issue 7 months ago • 2 comments
trafficstars

When installing docker using this role, setting the docker daemon option "metrics-addr" has no effect until the daemon is manually restarted:

  - name: Install Docker
    ansible.builtin.import_role:
      name: geerlingguy.docker
    vars:
      docker_daemon_options:
        metrics-addr: "0.0.0.0:9323"
$ sudo journalctl -u docker.service -g 'metrics API listening'
-- No entries --
$ sudo systemctl restart docker.service
$ sudo journalctl -u docker.service -g 'metrics API listening'
Apr 02 12:22:03 swarm-manager dockerd[27638]: time="2025-04-02T12:22:03.257149941+01:00" level=info msg="metrics API listening on [::]:9323"

This is true whether or not this is a completely fresh install of docker.

Am I missing something? Is the intention that docker will use these options when it first starts? And what is the best way to restart the daemon when it is already running when this role changes the options?

boite avatar Apr 02 '25 11:04 boite