Skip to content

Commit

Permalink
APT key: don't force and provide checksum, to fix check mode
Browse files Browse the repository at this point in the history
As described in ansible/ansible#65687, get_url
only partially supports check_mode: "the changed status will reflect
comparison to an empty source file".

Before this change, executing this code, with the key already being in
place on the target system, would report "OK", while check_mode would
report "changed".

Due to this change, both now either report "OK" or "changed", depending
on the state of the target system.
  • Loading branch information
nevart committed Jun 15, 2023
1 parent a29e9d5 commit fffda2c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tasks/setup-Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
url: "{{ docker_apt_gpg_key }}"
dest: /etc/apt/trusted.gpg.d/docker.asc
mode: '0644'
force: true
force: false
checksum: sha256:1500c1f56fa9e26b9b8f42452a553675796ade0807cdce11975eb98170b3a570
register: add_repository_key
ignore_errors: "{{ docker_apt_ignore_key_error }}"
when: docker_add_repo | bool
Expand Down

0 comments on commit fffda2c

Please sign in to comment.