Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Adding the ability for the role to create individual /etc/sudoers.d/ … #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bschonec
Copy link

…files instead of one, monolithic file.

I'd like to get your opinion on changing the fundamental properties of how this role works. This is still a W.I.P., but I'd like to submit a pull request just to get on your radar.

There are good reasons to have the ability to create multiple /etc/sudoers.d/ files. My changes preserve the ability to create a single, monolithic file yet still have the ability to create multiple files.

I have added a 'comment' field and modified the sudoers template quite a bit. The sudoers template has the ability to allow both users and groups in a single sudoers file.

I'm not so sure that my /etc/sudoers.d/ cleanup process is the best way to do it. Creating that sudo_keep list seems kinda hacky; perhaps other eyes on the code can find a better way.

@franklinkim
Copy link
Member

Hi, thanks for the PR!

I don't yet think splitting up the files is necessary (see #29)

I like the idea of adding aliases to the config but I think we could keep it simple and give the user the ability to manage the aliases themselves.

What about providing aliases through the config like this:

...
sudo_sudoers_host_aliases: 
  LAN: 
    - mario.host.com
    - lucy.host.com
sudo_sudoers_user_aliases:
  WEBADMIN: ankit, sam
sudo_sudoers_cmd_aliases:
  BIN = /bin/rpm, /bin/rm, /sbin/linuxconf
...

and adding them to the file

...
{% for key, value in sudo_sudoers_host_aliases %}
Host_Alias {{ key }} = {{ value if value is string else value | join(',') }}
{% enfor %}
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants