1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/plugins/modules
patchback[bot] d0b39271b3
Sudoers validate (#4794) (#4866)
* Use visudo to validate sudoers rules before use

* Replace use of subprocess.Popen with module.run_command

* Switch out apt for package

* Check file mode when verifying file to determine whether something needs to change

* Only install sudo package for debian and redhat environments (when testing)

* Attempt to install sudo on FreeBSD too

* Try just installing sudo for non-darwin machines

* Don't validate file ownership

* Attempt to install sudo on all platforms

* Revert "Attempt to install sudo on all platforms"

This reverts commit b9562a8916.

* Remove file permissions changes from this PR

* Add changelog fragment for 4794 sudoers validation

* Add option to control when sudoers validation is used

* Update changelog fragment

Co-authored-by: Felix Fontein <felix@fontein.de>

* Add version_added to validation property

Co-authored-by: Felix Fontein <felix@fontein.de>

* Also validate failed sudoers validation error message

Co-authored-by: Felix Fontein <felix@fontein.de>

* Make visudo not executable instead of trying to delete it

* Update edge case validation

* Write invalid sudoers file to alternative path to avoid breaking sudo

* Don't try to remove or otherwise modify visudo on Darwin

* Update plugins/modules/system/sudoers.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Remove trailing extra empty line to appease sanity checker

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 97c72f88b7)

Co-authored-by: Jon Ellis <ellis.jp@gmail.com>
2022-06-21 12:52:21 +02:00
..
cloud Add scw_compute_private_network (#4727) (#4845) 2022-06-15 10:58:13 +02:00
clustering consul: applied bugfix from issue (#4712) (#4716) 2022-05-23 07:37:08 +02:00
database Fix sanity issues. (#4346) 2022-03-14 20:56:27 +01:00
files Document all filter and test plugins (#4597) 2022-05-02 07:25:45 +02:00
identity keycloak_realm: fix default groups and roles (#4241) (#4719) (#4754) 2022-05-30 12:55:41 +02:00
monitoring New module alerta_customer (#4554) 2022-04-26 07:58:32 +02:00
net_tools nmcli: do not convert undefined lists to empty strings (#4813) (#4834) 2022-06-13 12:13:05 +02:00
notification Replace symlinks with meta/runtime.yml redirects. (#4562) 2022-04-26 20:33:13 +02:00
packaging redhat_subscription: call 'remove' instead of 'unsubscribe' (#4809) (#4838) 2022-06-14 07:53:49 +02:00
remote_management DOC: Documment setting of NTP server in examples. (#4655) (#4748) 2022-05-30 07:04:59 +02:00
source_control gitlab_hook: use None for non-existent attr in gitlab API response (#4668) 2022-05-17 07:45:10 +02:00
storage Fix quoting bug in zfs. (#4726) (#4744) 2022-05-29 07:59:03 +02:00
system Sudoers validate (#4794) (#4866) 2022-06-21 12:52:21 +02:00
web_infrastructure jira: Use fields in comment to merge in additional data (#4304) 2022-03-12 07:30:28 +01:00