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
Jon Ellis 97c72f88b7
Sudoers validate (#4794)
* 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>
2022-06-21 12:41:24 +02:00
..
aix_devices.py
aix_filesystem.py aix_filesystems - invoke run_command passing list (#3833) 2021-12-09 21:19:44 +01:00
aix_inittab.py
aix_lvg.py aix_lvg - invoke run_command passing list (#3834) 2021-12-09 21:20:12 +01:00
aix_lvol.py
alternatives.py Fix alternatives module (#4836) 2022-06-14 16:02:31 +02:00
awall.py
beadm.py
capabilities.py
cronvar.py
crypttab.py
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
filesystem.py Add RHEL 9.0, FreeBSD 13.1, Ubuntu 22.04 and Fedora 36 to CI, fix bug in filesystem module (#4700) 2022-05-22 17:20:30 +02:00
gconftool2.py gconftool2: improvements (#4647) 2022-05-12 07:10:34 +02:00
gconftool2_info.py gconftool2_info: new module (#4743) 2022-06-04 09:13:53 +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
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
keyring.py Add keyring and keyring_info modules (#4764) 2022-06-20 19:15:08 +02:00
keyring_info.py Add keyring and keyring_info modules (#4764) 2022-06-20 19:15:08 +02:00
launchd.py
lbu.py
listen_ports_facts.py Fix local port regex in listen_ports_facts (#4092) 2022-01-31 19:33:11 +01:00
locale_gen.py
lvg.py
lvol.py
make.py
mksysb.py Multiple modules using ModuleHelper (#4674) 2022-05-23 07:19:24 +02:00
modprobe.py
nosh.py Docs improvements. (#3893) 2021-12-12 11:01:14 +01:00
ohai.py
open_iscsi.py Fix sanity issues. (#4346) 2022-03-14 20:56:27 +01:00
openwrt_init.py
osx_defaults.py
pam_limits.py
pamd.py
parted.py
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) 2022-06-06 10:32:20 +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
sap_task_list_execute.py
sefcontext.py
selinux_permissive.py Fix sanity issues. (#4346) 2022-03-14 20:56:27 +01:00
selogin.py
seport.py seport: minor refactor (#4471) 2022-04-10 14:34:15 +02:00
shutdown.py
solaris_zone.py
ssh_config.py
sudoers.py Sudoers validate (#4794) 2022-06-21 12:41:24 +02:00
svc.py svc - invoke run_command passing list (#3829) 2021-12-01 13:18:38 +01:00
syspatch.py
sysrc.py
sysupgrade.py
timezone.py small docs update for timezone module (#3876) 2021-12-09 20:49:21 +01:00
ufw.py
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) 2022-06-15 08:06:26 +02:00
xfconf_info.py xfconf module utils: providing a cmd_runner object (#4776) 2022-06-06 10:38:46 +02:00
xfs_quota.py