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/system
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
..
aix_devices.py Tidy up validate-modules:doc-required-mismatch (#1415) 2020-11-28 14:06:28 +01:00
aix_filesystem.py aix_filesystems - invoke run_command passing list (#3833) 2021-12-09 21:19:44 +01:00
aix_inittab.py Enabling validation-modules for system modules (#1212) 2020-11-04 09:02:50 +01:00
aix_lvg.py aix_lvg - invoke run_command passing list (#3834) 2021-12-09 21:20:12 +01:00
aix_lvol.py Enabling validation-modules for system modules (#1212) 2020-11-04 09:02:50 +01:00
alternatives.py Fix alternatives module (#4836) (#4840) 2022-06-14 16:30:42 +02:00
awall.py Enabling validation-modules for system modules (#1212) 2020-11-04 09:02:50 +01:00
beadm.py rewritten as list literals (#2160) 2021-04-05 09:22:06 +02:00
capabilities.py [capabilities] fix for a newer versions of libcap (#1061) 2020-10-16 21:03:54 +02:00
cronvar.py Tidy up all pylint:blacklisted-name ignore lines (#1819) 2021-02-16 08:03:51 +01:00
crypttab.py Replace ansible.module_utils._text by ansible.module_utils.common.text.converters (#2877) 2021-06-26 23:59:11 +02:00
dconf.py dconf: Skip processes that disappeared while we inspected them (#4153) 2022-02-10 07:15:37 +01:00
dpkg_divert.py Prepare for distutils.version being removed in Python 3.12 (#3936) 2021-12-24 17:34:48 +00:00
facter.py Added Arguments for Facter module (#768) 2020-11-23 18:59:09 +01:00
filesystem.py Add RHEL 9.0, FreeBSD 13.1, Ubuntu 22.04 and Fedora 36 to CI, fix bug in filesystem module (#4700) (#4710) 2022-05-22 17:48:34 +02:00
gconftool2.py gconftool2: improvements (#4647) 2022-05-12 07:10:34 +02:00
gconftool2_info.py gconftool2_info: new module (#4743) (#4773) 2022-06-06 10:30:24 +02:00
homectl.py New Module: Homectl module for managing systemd-homed (#4018) 2022-01-28 07:11:12 +01:00
interfaces_file.py interfaces_file - fixed dup options bug (#3862) 2021-12-07 21:54:54 +01:00
iptables_state.py Replace ansible.module_utils._text by ansible.module_utils.common.text.converters (#2877) 2021-06-26 23:59:11 +02:00
java_cert.py java_cert - invoke run_command passing list (#3835) 2021-12-03 07:27:03 +01:00
java_keystore.py [5.0.0] Remove Ansible 2.9 / ansible-base 2.10 compatibility code (#4548) 2022-04-26 11:51:01 +02:00
kernel_blacklist.py kernel_blacklist - revamped the module (#3329) 2021-09-20 19:39:35 +02:00
keyring.py Add keyring and keyring_info modules (#4764) (#4864) 2022-06-20 18:27:10 +00:00
keyring_info.py Add keyring and keyring_info modules (#4764) (#4864) 2022-06-20 18:27:10 +00:00
launchd.py Fix new devel sanity errors. (#3194) 2021-08-12 12:07:50 +02:00
lbu.py mass-added the utf-8 marker (#3163) 2021-08-08 10:40:22 +02:00
listen_ports_facts.py Fix local port regex in listen_ports_facts (#4092) 2022-01-31 19:33:11 +01:00
locale_gen.py Replace ansible.module_utils._text by ansible.module_utils.common.text.converters (#2877) 2021-06-26 23:59:11 +02:00
lvg.py Tidy up all pylint:blacklisted-name ignore lines (#1819) 2021-02-16 08:03:51 +01:00
lvol.py Rework safety check on size arguments for when LV doesn't exist (#3681) 2021-11-13 14:00:32 +01:00
make.py added jobs parameter to make module (#1550) 2021-01-16 22:12:45 +01:00
mksysb.py Multiple modules using ModuleHelper (#4674) (#4713) 2022-05-23 07:32:54 +02:00
modprobe.py modprobe - fix task status when module cannot be loaded (#2843) 2021-06-26 23:27:41 +12:00
nosh.py Docs improvements. (#3893) 2021-12-12 11:01:14 +01:00
ohai.py Fix M(). (#591) 2020-06-29 14:59:15 +02:00
open_iscsi.py Fix sanity issues. (#4346) 2022-03-14 20:56:27 +01:00
openwrt_init.py openwrt_init - improvements (#3284) 2021-08-28 21:50:09 +02:00
osx_defaults.py Mark non-secret leaking module options with no_log=False (#2001) 2021-03-12 08:51:47 +01:00
pam_limits.py Replace ansible.module_utils._text by ansible.module_utils.common.text.converters (#2877) 2021-06-26 23:59:11 +02:00
pamd.py pamd - fixed issue+minor refactorings (#3285) 2021-08-31 12:34:57 +02:00
parted.py Fix repeated word in description of fs_type (#2717) 2021-06-04 19:11:46 +02:00
pids.py Prepare for distutils.version being removed in Python 3.12 (#3936) 2021-12-24 17:34:48 +00:00
puppet.py Add puppet confdir option (#4740) (#4787) 2022-06-06 10:57:37 +02:00
python_requirements_info.py python_requirements_info: don't overwrite results in 'mismatched' dict key (#4078) 2022-01-29 15:30:07 +01:00
runit.py Remove deprecated options, aliases and defaults (#3461) 2021-10-12 13:56:15 +02:00
sap_task_list_execute.py SAP task list execution (#3169) 2021-08-09 22:52:44 +02:00
sefcontext.py Replace ansible.module_utils._text by ansible.module_utils.common.text.converters (#2877) 2021-06-26 23:59:11 +02:00
selinux_permissive.py Fix sanity issues. (#4346) 2022-03-14 20:56:27 +01:00
selogin.py mass-added the utf-8 marker (#3163) 2021-08-08 10:40:22 +02:00
seport.py seport: minor refactor (#4471) 2022-04-10 14:34:15 +02:00
shutdown.py New module: shutdown (#700) 2020-08-11 17:54:41 +02:00
solaris_zone.py Enabling validation-modules for system modules (#1212) 2020-11-04 09:02:50 +01:00
ssh_config.py ssh_config: Add 'forwardagent' option (#3495) 2021-10-14 21:24:23 +02:00
sudoers.py Sudoers validate (#4794) (#4866) 2022-06-21 12:52:21 +02:00
svc.py svc - invoke run_command passing list (#3829) 2021-12-01 13:18:38 +01:00
syspatch.py mass-added the utf-8 marker (#3163) 2021-08-08 10:40:22 +02:00
sysrc.py New sysrc module for managing rc files on FreeBSD (#1460) 2021-01-16 14:14:23 +01:00
sysupgrade.py mass-added the utf-8 marker (#3163) 2021-08-08 10:40:22 +02:00
timezone.py small docs update for timezone module (#3876) 2021-12-09 20:49:21 +01:00
ufw.py [ufw] Insert or delete biased when deletion enabled - as for append or delete. (#3514) 2021-10-07 15:31:38 +02:00
vdo.py vdo: Remove unused variable (#4163) 2022-02-07 20:12:44 +01:00
xfconf.py cmd_runner: add __call__ method to invoke context (#4791) (#4844) 2022-06-15 10:58:04 +02:00
xfconf_info.py xfconf module utils: providing a cmd_runner object (#4776) (#4789) 2022-06-06 11:11:25 +02:00
xfs_quota.py bugfix: xfs_quota feedback on projects not initialized has changed (#1596) 2021-02-27 08:38:24 +01:00