Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docker] Ability to define GPG key path for Docker APT #10513

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,9 @@ Adding extra options to pass to the docker daemon:
## This string should be exactly as you wish it to appear.
docker_options: ""
```

For Debian based distributions, set the path to store the GPG key to avoid using the default one used in `apt_key` module (e.g. /etc/apt/trusted.gpg)

```yaml
docker_repo_key_keyring: /etc/apt/trusted.gpg.d/docker.gpg
```
3 changes: 3 additions & 0 deletions roles/container-engine/docker/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ docker_cli_version: "{{ docker_version }}"
docker_package_info:
pkgs:

# Path where to store repo key
# docker_repo_key_keyring: /etc/apt/trusted.gpg.d/docker.gpg

docker_repo_key_info:
repo_keys:

Expand Down
1 change: 1 addition & 0 deletions roles/container-engine/docker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
apt_key:
id: "{{ item }}"
url: "{{ docker_repo_key_info.url }}"
keyring: "{{ docker_repo_key_keyring|default(omit) }}"
state: present
register: keyserver_task_result
until: keyserver_task_result is succeeded
Expand Down
1 change: 1 addition & 0 deletions tests/files/packet_debian12-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ mode: default
container_manager: docker
etcd_deployment_type: docker
resolvconf_mode: docker_dns
docker_repo_key_keyring: /etc/apt/trusted.gpg.d/docker.gpg
1 change: 1 addition & 0 deletions tests/files/packet_ubuntu22-aio-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ enable_nodelocaldns: False
container_manager: docker
etcd_deployment_type: docker
resolvconf_mode: docker_dns
docker_repo_key_keyring: /etc/apt/trusted.gpg.d/docker.gpg