WIP: Adding the ability for the role to create individual /etc/sudoers.d/ …#31
Open
bschonec wants to merge 1 commit intoweareinteractive:masterfrom
bschonec:multi_file_sudoers
Open
WIP: Adding the ability for the role to create individual /etc/sudoers.d/ …#31bschonec wants to merge 1 commit intoweareinteractive:masterfrom bschonec:multi_file_sudoers
bschonec wants to merge 1 commit intoweareinteractive:masterfrom
bschonec:multi_file_sudoers
Conversation
…files instead of one, monolithic file.
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 %}
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…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.