Compare commits

...

9 Commits

Author SHA1 Message Date
Jeff Geerling
94b787389d
Merge pull request #504 from geerlingguy/revert-498-patch-1
Revert "Ensure the Docker daemon options file (`/etc/docker/daemon.json`) is deleted when no longer needed"
2025-04-05 07:42:05 -07:00
Jeff Geerling
24dee13f70
Revert "Ensure the Docker daemon options file (/etc/docker/daemon.json) is deleted when no longer needed" 2025-04-05 07:41:55 -07:00
Jeff Geerling
c8df987a56
Merge pull request #498 from spantaleev/patch-1
Ensure the Docker daemon options file (`/etc/docker/daemon.json`) is deleted when no longer needed
2025-04-05 07:41:35 -07:00
Jeff Geerling
d95b3fdc47
Merge pull request #497 from AliMehraji/master
update: docker_yum_gpg_key variable to get the distro gpg key
2025-04-05 07:40:36 -07:00
Ali Mehraji
1000ee6000
Merge branch 'geerlingguy:master' into master 2025-03-24 15:14:54 +03:30
Jeff Geerling
9115e969c1
Merge pull request #501 from adamus1red/adamus1red/alpine-compose
add compose package to Alpine specific variables
2025-03-23 19:00:51 -05:00
adamus1red
0f44fe621a
add compose package to Alpine specific variables 2025-03-23 19:26:14 +00:00
Slavi Pantaleev
5a2fd928ad
Ensure the Docker daemon options file (/etc/docker/daemon.json) is deleted when no longer needed
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.
2025-03-09 16:20:51 +02:00
Ali Mehraji
6f0503c0fb update: docker_yum_gpg_key variable to get the distro specific yum gpg key 2025-02-19 12:54:53 +03:30
3 changed files with 3 additions and 2 deletions

View File

@ -106,7 +106,7 @@ Usually in combination with changing `docker_apt_repository` as well. `docker_ap
docker_yum_repo_url: "{{ docker_repo_url }}/{{ (ansible_distribution == 'Fedora') | ternary('fedora','centos') }}/docker-{{ docker_edition }}.repo"
docker_yum_repo_enable_nightly: '0'
docker_yum_repo_enable_test: '0'
docker_yum_gpg_key: "{{ docker_repo_url }}/centos/gpg"
docker_yum_gpg_key: "{{ docker_repo_url }}/{{ (ansible_distribution == 'Fedora') | ternary('fedora', 'centos') }}/gpg"
```
(Used only for RedHat/CentOS.) You can enable the Nightly or Test repo by setting the respective vars to `1`.

View File

@ -59,7 +59,7 @@ docker_apt_filename: "docker"
docker_yum_repo_url: "{{ docker_repo_url }}/{{ (ansible_distribution == 'Fedora') | ternary('fedora','centos') }}/docker-{{ docker_edition }}.repo"
docker_yum_repo_enable_nightly: '0'
docker_yum_repo_enable_test: '0'
docker_yum_gpg_key: "{{ docker_repo_url }}/centos/gpg"
docker_yum_gpg_key: "{{ docker_repo_url }}/{{ (ansible_distribution == 'Fedora') | ternary('fedora', 'centos') }}/gpg"
# A list of users who will be added to the docker group.
docker_users: []

View File

@ -1,2 +1,3 @@
---
docker_packages: "docker"
docker_compose_package: docker-cli-compose