Skip to content

Commit

Permalink
Ability to define GPG key path for Docker APT
Browse files Browse the repository at this point in the history
  • Loading branch information
emiran-orange committed Oct 12, 2023
1 parent b2d8ec6 commit 027eaf6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
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

0 comments on commit 027eaf6

Please sign in to comment.