Skip to content

Commit a330aeb

Browse files
author
Aaron Hicks
committed
Add parameter to allow setting the puppet user shell command
1 parent 0319831 commit a330aeb

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

README.markdown

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ The `puppet` class installs puppet from packages available to whichever reposito
3232
* **user**: Specifies the puppet user account. The default value is `puppet`.
3333
* **gid**: The primary group identity of the puppet user. The default value is `puppet`.
3434
* **user_home**: Sets the home directory for the puppet user. The default value is `/var/lib/puppet`.
35+
* **user_shell**: Sets the shell command for the puppet user. The default value is `/bin/false` which prevents shell access for the puppet user.
3536
* **conf_dir**: Sets the directory where the puppet configuration file is stored. The default is `/etc/puppet`.
3637
* **var_dir**: This sets the puppet working directory that contains cached data, configurations and reports. The default is `/var/lib/puppet`.
3738
* **ssl_dir**: This sets the directory where puppet stores SSL state, including certificates and keys. The default is `/var/lib/puppet/ssl`.
@@ -100,7 +101,7 @@ This class installs a Puppetmaster on [Passenger](https://www.phusionpassenger.c
100101
* **basemodulepaths**: This expects an array of paths for a Puppetmaster to look for Puppet Modules. This list must include `/usr/share/puppet/modules` and will append it if omitted. The default is undefined, which will revert to the puppet default.
101102
* **autosign**: This sets the path to either an `autosign.conf` whitelist of approved domain names and globs, or an executable that can verifiy host names for [policy based autosigning](https://docs.puppetlabs.com/puppet/latest/reference/ssl_autosign.html). The default is undefined, which will use the whitelist in `$confdir/autosign.conf` by default.
102103
* **autosign_conf_path**: This sets the path to the `autosign.conf` whitelist file if the default path of `$confdir/autosign.conf` is not desired.
103-
* **trusted_node_data*: If set to true this will enable the use of the `$trusted` has in puppet manifests and prevent the `$trusted` hash from being altered or set in manifests. The default setting is false.
104+
* **trusted_node_data**: If set to true this will enable the use of the `$trusted` has in puppet manifests and prevent the `$trusted` hash from being altered or set in manifests. The default setting is false.
104105

105106
**NOTE**: Setting the `http` report handler without providing a reporting URL to the `reporturl` parameter may lead to unexpected behaviour by the Puppetmaster.
106107

manifests/init.pp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
$user = $::puppet::params::user,
3434
$gid = $::puppet::params::gid,
3535
$user_home = $::puppet::params::user_home,
36+
$user_shell = $::puppet::params::user_shell,
3637
$conf_dir = $::puppet::params::conf_dir,
3738
$log_dir = $::puppet::params::log_dir,
3839
$ssl_dir = $::puppet::params::ssl_dir,
@@ -120,7 +121,7 @@
120121
name => $user,
121122
gid => $gid,
122123
comment => 'Puppet configuration management daemon',
123-
shell => '/bin/false',
124+
shell => $user_shell,
124125
home => $user_home,
125126
managehome => false,
126127
require => Package['puppet'],

manifests/params.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
$user = 'puppet'
1313
$gid = 'puppet'
1414
$user_home = '/var/lib/puppet'
15+
$user_shell = '/bin/false'
1516
$log_dir = '/var/log/puppet'
1617
$var_dir = '/var/lib/puppet'
1718
$ssl_dir = "${var_dir}/ssl"

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Aethylred-puppet",
3-
"version": "1.4.2",
3+
"version": "1.5.0",
44
"author": "Aaron Hicks <aethylred@gmail.com>",
55
"license": "Licensed under GPL3",
66
"summary": "A Puppet module for installing, configuring and managing puppet, puppetmaster, and hiera.",

spec/classes/init_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,16 @@
276276
'home' => '/some/other/path'
277277
)}
278278
end
279+
describe 'with user_shell => /bin/bash' do
280+
let :params do
281+
{
282+
:user_shell => '/bin/bash',
283+
}
284+
end
285+
it { should contain_user('puppet_user').with(
286+
'shell' => '/bin/bash'
287+
)}
288+
end
279289
describe 'with a custom conf_dir' do
280290
let :params do
281291
{

0 commit comments

Comments
 (0)