cookbook 'sudo_rules', '~> 0.1.5'
sudo_rules (6) Versions 0.1.5 Follow4
Configures sudo rules from data bags using the sudo cookbook
cookbook 'sudo_rules', '~> 0.1.5', :supermarket
knife supermarket install sudo_rules
knife supermarket download sudo_rules
sudo_rules Cookbook
Reads through a special data bag of sudo rules to compile a list of sudoers.d rules to create/remove.
Requirements
packages
- sudo
Attributes
sudo_rules::default
Key | Type | Description | Default |
---|---|---|---|
['sudo_rules']['data_bag'] |
String | Name of data bag to use for entries. | sudo_rules |
['sudo_rules']['search_query'] |
String | Custom search query for matching instead of just host:fqdn | None |
data bag
Key | Type | Description | Default | Required? |
---|---|---|---|---|
id |
String | Name of Data Bag item, and sudoers.d/Id filename. | None | Yes |
name |
String | Instead of using Id, you can choose the name of the file for sudoers.d/Name instead. | Same as Id | No |
hosts |
Array | List of hosts to apply this rule to by fqdn, can be wildcard matched. | [] | Yes |
action |
String |
create or remove Sets whether to create or remove the entry. |
create |
No |
user |
String | Username or %Groupname to use for the sudo rule. | None | Yes |
runas |
String | Allowed colon-separated list of users for sudoers runas. | ALL |
No |
commands |
Array | List of commands (and arguments) this rule adds for the user/group. | [] | Yes |
defaults |
Array | List of defaults this user has. | [] | No |
Usage
sudo_rules::default
Include sudo_rules
in your node's run_list
:
{ "name":"my_node", "run_list": [ "recipe[sudo_rules]" ] }
And provide properly formatted data bag:
{ "id": "Data Bag unique name, default value for name below", "name": "Name of the sudoers.d file", "hosts": [ "fqdn1", "fqdn2", ... ], "action": "create", "user": "someuser", "runas": "ALL", "commands": [ "/usr/sbin/somecommand args", "/usr/sbin/anothercommand", ... ], "defaults": [ "env_reset" ] }
Contributing
- Fork the repository on Github.
- Switch to the develop branch.
- Create a named feature branch off develop (like
githubusername/feature/add_component_x
). - Write your change.
- Update documentation if appropriate.
- Write tests for your change (if applicable).
- Run the tests, ensuring they all pass.
- Submit a Pull Request using Github to develop branch.
or
- Report issue on Github
License and Authors
- Authors:
- Eric Renfro erenfro@linux-help.org
- Contributors:
- Pieter Vogelaar
Dependent cookbooks
sudo >= 2.7.1 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
sudo_rules CHANGELOG
This file is used to list changes made in each version of the sudo_rules cookbook.
0.1.3
- [erenfro] - LICENSE added.
0.1.2
- [erenfro] - Code cleanup, documentation cleanup.
0.1.1
- [erenfro] - Cleanup typos.
0.1.0
- [erenfro] - Initial release of sudo_rules
Check the Markdown Syntax Guide for help with Markdown.
The Github Flavored Markdown page describes the differences between markdown on github and standard markdown.
Collaborator Number Metric
0.1.5 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.1.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.1.5 failed this metric
FC120: Do not set the name property directly on a resource: sudo_rules/recipes/default.rb:85
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.1.5 passed this metric
Testing File Metric
0.1.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.1.5 failed this metric
0.1.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.1.5 failed this metric
FC120: Do not set the name property directly on a resource: sudo_rules/recipes/default.rb:85
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.1.5 passed this metric
Testing File Metric
0.1.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.1.5 failed this metric
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
0.1.5 passed this metric
Testing File Metric
0.1.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.1.5 failed this metric
0.1.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number