Skip to content

Commit

Permalink
[debops.keyring] Fix usage in Ansible check mode
Browse files Browse the repository at this point in the history
  • Loading branch information
drybjed committed Aug 9, 2019
1 parent 59a717d commit 0285068
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ansible/roles/debops.keyring/tasks/main.yml
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0285068

Please sign in to comment.