-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sudoers module does not handle state: absent properly #4852
Comments
Files identified in the description: If these files are incorrect, please update the |
cc @JonEllis @JonEllis0 |
ansibullbot
added
bug
This issue/PR relates to a bug
module
module
plugins
plugin (any type)
system
labels
Jun 18, 2022
felixfontein
pushed a commit
that referenced
this issue
Jun 19, 2022
felixfontein
pushed a commit
that referenced
this issue
Jun 19, 2022
felixfontein
pushed a commit
that referenced
this issue
Jun 19, 2022
bratwurzt
pushed a commit
to bratwurzt/community.general
that referenced
this issue
Nov 7, 2022
…sible-collections#4853) * sudoers: fix handling of state: absent (ansible-collections#4852) * typo fixes
1 task
1 task
1 task
1 task
ghost
mentioned this issue
Nov 7, 2022
1 task
1 task
1 task
1 task
1 task
1 task
This was referenced Nov 7, 2022
Closed
This was referenced Nov 20, 2022
Closed
Closed
Closed
Closed
Closed
Closed
This was referenced Dec 1, 2022
1 task
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
The
community.general.sudoers
module does not handlestate: absent
properly.If the file specified by
name
does not exist, it gets created, with possibly invalid content. As a side effect,commands
anduser
/group
is required, although these options do not make a lot of sense withstate: absent
.If the file specified by
name
exists, it is (correctly) deleted. Of course, the next invocation of the play creates it again.Issue Type
Bug Report
Component Name
sudoers
Ansible Version
Community.general Version
Configuration
$ ansible-config dump --only-changed
OS / Environment
Target OS is Debian 11.
Steps to Reproduce
Note:
/etc/sudoers.d/test
is assumed not to exist prior to running this play.Expected Results
The play never fails, i.e.
/etc/sudoers.d/test
gets deleted/not created.Actual Results
The assertion fails on every second invocation of the play (starting with the first). The file
/etc/sudoers.d/test
gets created by thesudoers
module.The assertion passes on every other invocation of the play (starting with the second).
Code of Conduct
The text was updated successfully, but these errors were encountered: