Skip to content

Commit

Permalink
Merge pull request #11782 from comps/use_failed_when_false
Browse files Browse the repository at this point in the history
use `failed_when:false` for Ansible `register:` checks
  • Loading branch information
jan-cerny authored Apr 3, 2024
2 parents 695c283 + 40fdde4 commit 18608b6
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- name: "Test for domain group"
command: grep '^\s*\[domain\/[^]]*]' /etc/sssd/sssd.conf
register: test_grep_domain
ignore_errors: yes
failed_when: false
changed_when: False
check_mode: no

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- name: "Test for domain group"
command: grep '\s*\[domain\/[^]]*]' /etc/sssd/sssd.conf
register: test_grep_domain
ignore_errors: yes
failed_when: false
changed_when: False
check_mode: no

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- name: "Test for domain group"
command: grep '\s*\[domain\/[^]]*]' /etc/sssd/sssd.conf
register: test_grep_domain
ignore_errors: yes
failed_when: false
changed_when: False
check_mode: no

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- name: "Test for domain group"
command: grep '\s*\[domain\/[^]]*]' /etc/sssd/sssd.conf
register: test_grep_domain
ignore_errors: yes
failed_when: false
changed_when: False
check_mode: no

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
ansible.builtin.command:
cmd: semanage fcontext -a -t faillog_t "{{ var_accounts_passwords_pam_faillock_dir }}(/.*)?"
register: result_accounts_passwords_pam_faillock_dir_semanage
ignore_errors: yes
failed_when: false
changed_when:
- result_accounts_passwords_pam_faillock_dir_semanage.rc == 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- name: "{{{ rule_title }}} - Check to See the Current Status of FIPS Mode"
ansible.builtin.command: /usr/bin/fips-mode-setup --check
register: is_fips_enabled
ignore_errors: yes
failed_when: false
changed_when: false

- name: "{{{ rule_title }}} - Enable FIPS Mode"
Expand Down

0 comments on commit 18608b6

Please sign in to comment.