mirror of
				https://github.com/geerlingguy/ansible-role-docker.git
				synced 2025-10-24 11:16:46 +02:00 
			
		
		
		
	| If people set options in `docker_daemon_options` (e.g. `{'ipv6': false}`), the role will create the `/etc/docker/daemon.json` file and populate it with the options.
Later on, if people stop setting *all of these* options, the file used to remain in place (containing the old options) and cause trouble. This is unexpected.
If the Docker installation is managed by this role and the `/etc/docker/daemon.json` file is managed by it, it should also take care to:
- either delete the file when it's no longer necessary
- or populate it with empty options if that is what `docker_daemon_options` contains
Deleting the file instead of putting `{}` in it seems like the cleaner approach.
There's a chance that people would like to manage options in `/etc/docker/daemon.json` by themselves (without Ansible) and this new behavior when `docker_daemon_options` is empty, but this runs against having a managed Docker installation via Ansible.
This patch only deletes the `/etc/docker/daemon.json` file.
We could possibly delete the `/etc/docker` directory too, but it's more tricky to delete it only when it's empty. In some cases, the directory may contain other files and invoking the `file` module with `state: absent` will delete everything recursively, which is undesirable. | ||
|---|---|---|
| .. | ||
| docker-compose.yml | ||
| docker-users.yml | ||
| main.yml | ||
| setup-Debian.yml | ||
| setup-RedHat.yml | ||