-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathparams.pp
More file actions
94 lines (79 loc) · 2.78 KB
/
params.pp
File metadata and controls
94 lines (79 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File:: <tt>params.pp</tt>
# Author:: Sebastien Varrette (Sebastien.Varrette@uni.lu)
# Copyright:: Copyright (c) 2011 Sebastien Varrette
# License:: GPLv3
#
# Time-stamp: <Ven 2014-09-05 21:43 svarrette>
# ------------------------------------------------------------------------------
# = Class: sudo::params
#
# In this class are defined as variables values that are used in other
# sudo classes.
# This class should be included, where necessary, and eventually be enhanced
# with support for more OS
#
# == Warnings
#
# /!\ Always respect the style guide available
# here[http://docs.puppetlabs.com/guides/style_guide]
#
# The usage of a dedicated param classe is advised to better deal with
# parametrized classes, see
# http://docs.puppetlabs.com/guides/parameterized_classes.html
#
# [Remember: No empty lines between comments and class definition]
#
class sudo::params {
######## DEFAULTS FOR VARIABLES USERS CAN SET ##########################
# (Here are set the defaults, provide your custom variables externally)
# (The default used is in the line with '')
###########################################
# ensure the presence (or absence) of sudo
$ensure = 'present'
#### MODULE INTERNAL VARIABLES #########
# (Modify to adapt to unsupported OSes)
#######################################
$packagename = $facts['os']['name'] ? {
default => 'sudo',
}
# The actual version of the package is provided by the
# custore fact 'sudoversion' (see lib/facter/sudo.rb)
# main configuration file
$configfile = $facts['os']['name'] ? {
default => '/etc/sudoers',
}
# backup of the main configuration file
$backupconfigfile = $facts['os']['name'] ? {
default => '/etc/.sudoers.puppet-save-orig',
}
$configfile_mode = $facts['os']['name'] ? {
default => '0440',
}
$configfile_owner = $facts['os']['name'] ? {
default => 'root',
}
$configfile_group = $facts['os']['name'] ? {
default => 'root',
}
# The next config dir only holds for sudo version >= 1.7.2
$configdir = $facts['os']['name'] ? {
default => '/etc/sudoers.d',
}
$configdir_mode = $facts['os']['name'] ? {
default => '0755',
}
$configdir_owner = $facts['os']['name'] ? {
default => 'root',
}
$configdir_group = $facts['os']['name'] ? {
default => 'root',
}
# name of the exec resource responsible for checking the syntax of the sudoers
# file
$check_syntax_name = 'sudoers-check-syntax'
$cmdalias_pkgmanager = $facts['os']['name'] ? {
/(?i-mx:ubuntu|debian)/ => [ '/usr/bin/apt-get' ],
/(?i-mx:centos|fedora|redhat|rocky)/ => [ '/bin/rpm', '/usr/bin/up2date', '/usr/bin/yum' ],
default => []
}
}