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_inittab.py
aix_lvg.py
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
dpkg_divert.py
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
interfaces_file.py
iptables_state.py
java_cert.py
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
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
ohai.py
open_iscsi.py
openwrt_init.py
osx_defaults.py
pam_limits.py
pamd.py
parted.py
pids.py
puppet.py Add puppet confdir option (#4740) 2022-06-06 10:32:20 +02:00
python_requirements_info.py
runit.py
sap_task_list_execute.py
sefcontext.py
selinux_permissive.py
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
syspatch.py
sysrc.py
sysupgrade.py
timezone.py
ufw.py
vdo.py
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