mirror of
https://github.com/dredx/prole.git
synced 2026-09-24 15:44:33 +00:00
ansible: guard krbtgt smoke probe against --check mode failure
In --check mode the user-create step is skipped (it's mutating), so the subsequent `samba-tool user show krbtgt/KNOE.LOCAL` probe fails with rc=1 on a first dry-run because the user doesn't yet exist. Add the same guarded failed_when used on the trust validate/show tasks earlier: only fail when NOT (check_mode AND trust didn't pre-exist). Real runs still fail hard on rc!=0. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
555da4acfc
commit
6740e3dcc5
@ -315,7 +315,12 @@
|
|||||||
register: _krbtgt_show
|
register: _krbtgt_show
|
||||||
changed_when: false
|
changed_when: false
|
||||||
check_mode: false
|
check_mode: false
|
||||||
failed_when: _krbtgt_show.rc != 0
|
# In --check mode the create step is skipped, so on a first dry
|
||||||
|
# run the user doesn't exist yet — don't fail the play in that
|
||||||
|
# case. Real runs still fail hard on rc!=0.
|
||||||
|
failed_when:
|
||||||
|
- _krbtgt_show.rc != 0
|
||||||
|
- not (ansible_check_mode and not _trust_exists)
|
||||||
|
|
||||||
- name: Print summary
|
- name: Print summary
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user