robertdebock / ansible-role-users

The purpose of this role is to add users and groups on your system.
https://robertdebock.nl/
Apache License 2.0
43 stars 27 forks source link

validate sudoers file #15

Closed markgraf closed 3 years ago

markgraf commented 3 years ago

Validate files in sudoers.d

name: Pull request about: Validate files in /etc/sudoers.d/ before writing them.

Describe the change Added validation of the templated changes to a sudoers.d-file. This prevents locking yourself out of your server if there's a typo in your sudo_options. The change is taken from the official documentation at https://docs.ansible.com/ansible/latest/collections/ansible/builtin/template_module.html

Testing Successfully converged the role with the change. Failed as expected when passing bogus options for sudo.

robertdebock commented 3 years ago

The failed CI is not your problem, I'll merge and fix CI.

Thanks for the helpful contribution!