When the Docker configuration file /etc/docker/daemon.json is updated, the containers of Plausible Analytics are not automatically removed and re-created. As a consequence, some configuration modifications like a change of the default logging driver won't automatically be effective after a deployment. A manual restart of tournesol-website-analytics with systemctl is required to apply the changes.
technical details
If following Ansible task updates the /etc/docker/daemon.json, a restart of the service should be triggered. Note that notifying a handler with only notify and listen won't work properly. The first time a VM is provisioned, the Plausible Analytics service doesn't exist when the following task is running. Triggering the restart of a non-existing service will make the deployment fail. The restart should be conditioned by the existence of the service.
only relevant if https://github.com/tournesol-app/tournesol/pull/1340 is merged
Context
When the Docker configuration file
/etc/docker/daemon.json
is updated, the containers of Plausible Analytics are not automatically removed and re-created. As a consequence, some configuration modifications like a change of the default logging driver won't automatically be effective after a deployment. A manual restart oftournesol-website-analytics
withsystemctl
is required to apply the changes.technical details
If following Ansible task updates the
/etc/docker/daemon.json
, a restart of the service should be triggered. Note that notifying a handler with onlynotify
andlisten
won't work properly. The first time a VM is provisioned, the Plausible Analytics service doesn't exist when the following task is running. Triggering the restart of a non-existing service will make the deployment fail. The restart should be conditioned by the existence of the service.