From fa445ac70ffe088e0f9195512350c5a1400b10f3 Mon Sep 17 00:00:00 2001 From: Arne Teuke Date: Fri, 28 Jul 2017 14:35:33 +0100 Subject: [PATCH] fixed typo --- manifests/main/config.pp | 2 +- manifests/main/install.pp | 2 +- manifests/main/user.pp | 50 +++++++++++++++++++++++++++++++++++++++ manifests/params.pp | 10 +++++++- 4 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 manifests/main/user.pp diff --git a/manifests/main/config.pp b/manifests/main/config.pp index 4901dce..7f64bbc 100644 --- a/manifests/main/config.pp +++ b/manifests/main/config.pp @@ -26,6 +26,6 @@ class cd_nrpe::main::config ( ) inherits cd_nrpe::params { - require cd_nrpe::main::install + include cd_nrpe::user } diff --git a/manifests/main/install.pp b/manifests/main/install.pp index 25c6c52..9c912c6 100644 --- a/manifests/main/install.pp +++ b/manifests/main/install.pp @@ -26,7 +26,7 @@ class cd_nrpe::main::install ( ) inherits cd_nrpe::params { - require cd_nrpe::resources + require cd_resources package {$reqpackages: ensure => $pkg_ensure, diff --git a/manifests/main/user.pp b/manifests/main/user.pp new file mode 100644 index 0000000..7e13246 --- /dev/null +++ b/manifests/main/user.pp @@ -0,0 +1,50 @@ +## cd_nrpe::user.pp +# Module name: cd_nrpe +# Author: Arne Teuke (arne_teuke@ConfDroid.com) +# # License: +# This file is part of cd_nrpe. +# +# cd_nrpe is used for providing automatic configuration of +# +# Copyright (C) 2016 ConfDroid (copyright@ConfDroid.com) +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# @summary Class manages service users for cd_nrpe. +############################################################################# +class cd_nrpe::user ( + +) inherits cd_nrpe::params { + + require cd_nrpe::main::install + + group { $ne_user: + ensure => present, + name => $ne_user, + gid => $ne_user_uid, + allowdupe => false, + } + + user { $ne_user: + ensure => present, + name => $ne_user, + allowdupe => false, + comment => $ne_user_comment, + uid => $ne_user_uid, + gid => $ne_user, + groups => $ne_user_groups, + managehome => true, + home => $ne_user_home, + shell => $ne_user_shell, + require => Group[$ne_user], + } +} diff --git a/manifests/params.pp b/manifests/params.pp index 7c28c98..fb599aa 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -27,7 +27,15 @@ ############################################################################## class cd_nrpe::params ( -$pkg_ensure = 'latest', +$pkg_ensure = 'latest', + +# user settings +$ne_user = 'nrpe' +$ne_user_comment = 'NRPE service user' +$ne_user_uid = '1005', +$ne_user_home = '/var/run/nagios', +$ne_user_groups = undef, +$ne_user_shell = '/sbin/nologin', ) {