- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with sudo
- Usage - Configuration options and additional functionality
- Reference
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
- Acceptance Tests
Constructs a sudoers file based on configuration aliases, defaults, and user specifications.
sudo will ensure the sudo package is installed, and will manage /etc/sudoers.
The only necessary steps to begin using sudo is the install pupmod-simp-sudo
into your modulepath
To create the default SIMP /etc/sudoers file:
include 'sudo'
Giving a user root permissions
# NOTE: '%' in sudo signifies a group
# %powerusers is the powerusers group
sudo::user_specification { 'power_users':
user_list => [ 'persona', 'personb', '%powerusers' ],
runas => 'root',
cmnd => [ '/bin/su root', '/bin/su - root' ]
}
Giving a system user access to a command without root
sudo::user_specification { 'myapp':
user_list => [ 'myappuser' ],
runas => 'root',
cmnd => [ '/usr/bin/someservice' ],
passwd => false,
}
To create a defaults line in sudoers:
# Creates Defaults requiretty, syslog=authpriv, !root_sudo, !umask, env_reset
sudo::default_entry { '00_main':
content => [ 'requiretty',
'syslog=authpriv',
'!root_sudo',
'!umask',
'env_reset',
],
}
To create the following alias in sudoers:
User_Alias FULLTIMERS = millert, mikef, dowdy
sudo::alias { 'FULLTIMERS':
content => [ 'millert','mikef','dowdy' ],
alias_type => 'user'
}
Additionally, these may be called by additional defined types for user, cmnd, host, or runas for easier readibility:
sudo::alias::user { 'FULLTIMERS':
content => [ 'millert','mikef','dowdy' ],
}
- sudo: Handles main /etc/sudoers file
- sudo::default_entry: Creates default entry
- sudo::user_specification: Creates user entry
- sudo::alias: Creates Aliases (Used by all other sudo::alias types)
- sudo::alias::cmnd: Creates Command Aliases
- sudo::alias::host: Creates Host Aliases
- sudo::alias::runas: Creates Run As Aliases
- sudo::alias::user: Creates User Aliases
SIMP Puppet modules are generally intended to be used on a Red Hat Enterprise Linux-compatible distribution.
Please read our Contribution Guide.
If you find any issues, they can be submitted to our JIRA.
To run the system tests, you need Vagrant
installed.
You can then run the following to execute the acceptance tests:
bundle exec rake beaker:suites
Some environment variables may be useful:
BEAKER_debug=true
BEAKER_provision=no
BEAKER_destroy=no
BEAKER_use_fixtures_dir_for_modules=yes
BEAKER_debug
: show the commands being run on the STU and their output.BEAKER_destroy=no
: prevent the machine destruction after the tests finish so you can inspect the state.BEAKER_provision=no
: prevent the machine from being recreated. This can save a lot of time while you're writing the tests.BEAKER_use_fixtures_dir_for_modules=yes
: cause all module dependencies to be loaded from thespec/fixtures/modules
directory, based on the contents of.fixtures.yml
. The contents of this directory are usually populated bybundle exec rake spec_prep
. This can be used to run acceptance tests to run on isolated networks.