Skip to content
Permalink
Browse files

[debops.keyring] Fix usage in Ansible check mode

  • Loading branch information...
drybjed committed Aug 9, 2019
1 parent 59a717d commit 0285068303f7d0242a602c7e38e0315a2f56bb80
Showing with 2 additions and 1 deletion.
  1. +2 −1 ansible/roles/debops.keyring/tasks/main.yml
@@ -93,6 +93,7 @@
- name: Gather information about existing UNIX accounts
getent:
database: 'passwd'
check_mode: False

# In some cases 'apt-key' command refuses to work complaining that it has to
# be run by root. This task should handle these cases gracefully.
@@ -128,7 +129,7 @@
become_user: '{{ item.user | d(keyring__dependent_gpg_user if keyring__dependent_gpg_user|d() else "root") }}'
loop: '{{ q("flattened", (keyring__dependent_gpg_keys)) }}'
register: keyring__register_gpg_key
until: keyring__register_gpg_key.rc == 0
until: keyring__register_gpg_key.rc|d(0) == 0
when: (keyring__enabled|bool and (item.id|d() or item is string) and
(item.user | d(keyring__dependent_gpg_user if keyring__dependent_gpg_user|d() else "root")) in getent_passwd.keys())
changed_when: '("Adding key..." in keyring__register_gpg_key.stdout_lines) or

0 comments on commit 0285068

Please sign in to comment.
You can’t perform that action at this time.