diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 887d571..9a98d90 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -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). diff --git a/manifests/command.pp b/manifests/command.pp index c849d3d..b92f7fa 100644 --- a/manifests/command.pp +++ b/manifests/command.pp @@ -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 diff --git a/manifests/params.pp b/manifests/params.pp index f2331ee..acd5d21 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -28,6 +28,8 @@ 'nagios-nrpe-server', 'nagios-plugins', ] + $sudo_command = '/usr/bin/sudo' + } 'Solaris': { $libdir = '/opt/csw/libexec/nagios-plugins' @@ -42,6 +44,7 @@ 'nrpe', 'nagios_plugins', ] + $sudo_command = '/usr/bin/sudo' } 'RedHat': { $libdir = fact('os.architecture') ? { @@ -59,6 +62,7 @@ 'nrpe', 'nagios-plugins-all', ] + $sudo_command = '/usr/bin/sudo' } 'FreeBSD': { $libdir = '/usr/local/libexec/nagios' @@ -73,6 +77,7 @@ 'net-mgmt/nrpe', 'net-mgmt/nagios-plugins', ] + $sudo_command = '/usr/local/bin/sudo' } 'OpenBSD': { $libdir = '/usr/local/libexec/nagios' @@ -87,6 +92,7 @@ 'nrpe', 'monitoring-plugins', ] + $sudo_command = '/usr/bin/sudo' } 'Suse': { $libdir = '/usr/lib/nagios/plugins' @@ -104,6 +110,7 @@ 'nagios-plugins', 'nagios-plugins-nrpe', ] + $sudo_command = '/usr/bin/sudo' } default: { $nrpe_config = '/etc/nrpe.cfg' @@ -113,6 +120,7 @@ 'nrpe', 'nagios-plugins-all', ] + $sudo_command = '/usr/bin/sudo' } } } @@ -132,6 +140,7 @@ 'net-analyzer/nrpe', 'net-analyzer/nagios-plugins', ] + $sudo_command = '/usr/bin/sudo' } default: { } diff --git a/metadata.json b/metadata.json index bff04f7..ab2de7e 100644 --- a/metadata.json +++ b/metadata.json @@ -27,19 +27,22 @@ { "operatingsystem": "RedHat", "operatingsystemrelease": [ - "7" + "7", + "8" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ - "7" + "7", + "8" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ - "7" + "7", + "8" ] }, { @@ -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" ] }, { @@ -67,7 +75,11 @@ ] }, { - "operatingsystem": "FreeBSD" + "operatingsystem": "FreeBSD", + "operatingsystemrelease": [ + "12.2", + "13.0" + ] }, { "operatingsystem": "Solaris" diff --git a/templates/command.cfg.epp b/templates/command.cfg.epp index 39d065d..a6aed0d 100644 --- a/templates/command.cfg.epp +++ b/templates/command.cfg.epp @@ -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 %> <%- } -%>