Skip to content

Commit

Permalink
Work around ansible/ansible#43670
Browse files Browse the repository at this point in the history
Avoid spurious "changed:" messages when creating / locking users that
already exist and are locked.
  • Loading branch information
jikamens committed Oct 26, 2018
1 parent 44f310a commit 1e0ca9e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions mod-relay.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,15 @@
value: email
when: ansible_distribution == 'Fedora'

# https://github.com/ansible/ansible/issues/43670
- shell: grep -q -s '^mtm:!:' /etc/shadow
ignore_errors: true
failed_when: false
changed_when: false
register: mtm_locked

- user: name=mtm password_lock=yes
when: mtm_locked.rc != 0

- file: dest=/home/mtm/bin state=directory

Expand All @@ -99,7 +107,15 @@
:0 w
|mail -s 'mtm message' root
# https://github.com/ansible/ansible/issues/43670
- shell: grep -q -s '^modupdate:!:' /etc/shadow
ignore_errors: true
failed_when: false
changed_when: false
register: modupdate_locked

- user: name=modupdate password_lock=yes
when: modupdate_locked.rc != 0

- name: install /home/modupdate/.procmailrc
copy:
Expand Down

0 comments on commit 1e0ca9e

Please sign in to comment.