mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 14:41:23 -07:00
[PR #9871/dd0a2cbf backport][stable-9] sudoers: display stderr raised while validation (#9884)
sudoers: display stderr raised while validation (#9871)
* sudoers: display stderr raised while validation
* Print stdout and stderr raised from sudoers validation
Fixes: #9674
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
* Apply suggestions from code review
Co-authored-by: Felix Fontein <felix@fontein.de>
---------
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit dd0a2cbff9
)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
e1b338cf41
commit
0dd960d8ab
3 changed files with 8 additions and 3 deletions
|
@ -229,7 +229,7 @@
|
|||
ignore_errors: true
|
||||
when: ansible_os_family != 'Darwin'
|
||||
register: edge_case_3
|
||||
|
||||
|
||||
- name: Revoke non-existing rule
|
||||
community.general.sudoers:
|
||||
name: non-existing-rule
|
||||
|
@ -278,12 +278,14 @@
|
|||
that:
|
||||
- not revoke_rule_1_stat.stat.exists
|
||||
- not revoke_non_existing_rule_stat.stat.exists
|
||||
|
||||
|
||||
- name: Check edge case responses
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- edge_case_1 is failed
|
||||
- "'Failed to validate sudoers rule' in edge_case_1.msg"
|
||||
- edge_case_1.stdout is defined
|
||||
- edge_case_1.stderr is defined
|
||||
- edge_case_2 is not failed
|
||||
|
||||
- name: Check missing validation edge case
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue