Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ The following strings are known to work:
* debian10
* centos7
* centos8
* freebsd12
* freebsd13

For more information and tips & tricks, see [voxpupuli-acceptance's documentation](https://github.com/voxpupuli/voxpupuli-acceptance#running-tests).

Expand Down
9 changes: 5 additions & 4 deletions manifests/command.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
# The user to run the command as when using sudo.
define nrpe::command (
String[1] $command,
Enum['present', 'absent'] $ensure = present,
Optional[Stdlib::Filemode] $file_mode = undef,
Boolean $sudo = false,
String[1] $sudo_user = 'root',
Enum['present', 'absent'] $ensure = present,
Optional[Stdlib::Filemode] $file_mode = undef,
Boolean $sudo = false,
String[1] $sudo_user = 'root',
String[1] $sudo_command = $nrpe::params::sudo_command,
) {
include nrpe

Expand Down
9 changes: 9 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
'nagios-nrpe-server',
'nagios-plugins',
]
$sudo_command = '/usr/bin/sudo'

}
'Solaris': {
$libdir = '/opt/csw/libexec/nagios-plugins'
Expand All @@ -42,6 +44,7 @@
'nrpe',
'nagios_plugins',
]
$sudo_command = '/usr/bin/sudo'
}
'RedHat': {
$libdir = fact('os.architecture') ? {
Expand All @@ -59,6 +62,7 @@
'nrpe',
'nagios-plugins-all',
]
$sudo_command = '/usr/bin/sudo'
}
'FreeBSD': {
$libdir = '/usr/local/libexec/nagios'
Expand All @@ -73,6 +77,7 @@
'net-mgmt/nrpe',
'net-mgmt/nagios-plugins',
]
$sudo_command = '/usr/local/bin/sudo'
}
'OpenBSD': {
$libdir = '/usr/local/libexec/nagios'
Expand All @@ -87,6 +92,7 @@
'nrpe',
'monitoring-plugins',
]
$sudo_command = '/usr/bin/sudo'
}
'Suse': {
$libdir = '/usr/lib/nagios/plugins'
Expand All @@ -104,6 +110,7 @@
'nagios-plugins',
'nagios-plugins-nrpe',
]
$sudo_command = '/usr/bin/sudo'
}
default: {
$nrpe_config = '/etc/nrpe.cfg'
Expand All @@ -113,6 +120,7 @@
'nrpe',
'nagios-plugins-all',
]
$sudo_command = '/usr/bin/sudo'
}
}
}
Expand All @@ -132,6 +140,7 @@
'net-analyzer/nrpe',
'net-analyzer/nagios-plugins',
]
$sudo_command = '/usr/bin/sudo'
}
default: {
}
Expand Down
24 changes: 18 additions & 6 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,22 @@
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"7"
"7",
"8"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"7"
"7",
"8"
]
},
{
"operatingsystem": "OracleLinux",
"operatingsystemrelease": [
"7"
"7",
"8"
]
},
{
Expand All @@ -51,13 +54,18 @@
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"8"
"9",
"10"
]
},
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"16.04"
"16.04",
"18.04",
"20.04",
"20.10",
"21.04"
]
},
{
Expand All @@ -67,7 +75,11 @@
]
},
{
"operatingsystem": "FreeBSD"
"operatingsystem": "FreeBSD",
"operatingsystemrelease": [
"12.2",
"13.0"
]
},
{
"operatingsystem": "Solaris"
Expand Down
4 changes: 2 additions & 2 deletions templates/command.cfg.epp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
| -%>
# Generated by puppet
<%- if $command =~ /^\// { -%>
command[<%= $command_name %>]=<% if $sudo { %>/usr/bin/sudo -u <%= $sudo_user %> <% } %><%= $command %>
command[<%= $command_name %>]=<% if $sudo { %><%= $sudo_command %> -u <%= $sudo_user %> <% } %><%= $command %>
<%- } else { -%>
command[<%= $command_name %>]=<% if $sudo { %>/usr/bin/sudo -u <%= $sudo_user %> <% } %><%= $libdir %>/<%= $command %>
command[<%= $command_name %>]=<% if $sudo { %><%= $sudo_command %> -u <%= $sudo_user %> <% } %><%= $libdir %>/<%= $command %>
<%- } -%>