adjusted all params etc
This commit is contained in:
@@ -1,30 +1,12 @@
|
||||
## cd_nagios::main::config.pp
|
||||
# Module name: cd_nagios
|
||||
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
|
||||
# # License:
|
||||
# This file is part of cd_nagios.
|
||||
#
|
||||
# cd_nagios is used for providing automatic configuration of Nagios
|
||||
# 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 <http://www.gnu.org/licenses/>.
|
||||
# @summary Class manages all aspects of configuring the module logic for
|
||||
# cd_nagios.
|
||||
##############################################################################
|
||||
class cd_nagios::main::config (
|
||||
|
||||
) inherits cd_nagios::params {
|
||||
|
||||
# manage server configuration
|
||||
|
||||
if $::fqdn == $ng_nagios_server {
|
||||
|
||||
@@ -1,228 +1,208 @@
|
||||
## cd_nagios::main::dirs.pp
|
||||
# Module name: cd_nagios
|
||||
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
|
||||
# # License:
|
||||
# This file is part of cd_nagios.
|
||||
#
|
||||
# cd_nagios is used for providing automatic configuration of Nagios.
|
||||
# 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 <http://www.gnu.org/licenses/>.
|
||||
# @summary Class manages all directories required for cd_nagios.
|
||||
###############################################################################
|
||||
class cd_nagios::main::dirs (
|
||||
|
||||
) inherits cd_nagios::params {
|
||||
|
||||
require cd_nagios::main::user
|
||||
|
||||
# main directory
|
||||
|
||||
file { $ng_main_dir:
|
||||
ensure => directory,
|
||||
path => $ng_main_dir,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => nagios_etc_t,
|
||||
seluser => system_u,
|
||||
ensure => directory,
|
||||
path => $ng_main_dir,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => nagios_etc_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
|
||||
# /usr/lib64/nagios dir required for plugins
|
||||
|
||||
file { $ng_lib_dir:
|
||||
ensure => directory,
|
||||
path => $ng_lib_dir,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => lib_t,
|
||||
seluser => system_u,
|
||||
ensure => directory,
|
||||
path => $ng_lib_dir,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => lib_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
|
||||
# /var/spool/nagios
|
||||
|
||||
file { $ng_spool_dir:
|
||||
ensure => directory,
|
||||
path => $ng_spool_dir,
|
||||
owner => $ng_user,
|
||||
group => $ng_user,
|
||||
mode => '0755',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => nagios_spool_t,
|
||||
seluser => system_u,
|
||||
ensure => directory,
|
||||
path => $ng_spool_dir,
|
||||
owner => $ng_user,
|
||||
group => $ng_user,
|
||||
mode => '0755',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => nagios_spool_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
|
||||
|
||||
if $::fqdn == $ng_nagios_server {
|
||||
|
||||
# /etc/nagios/conf.d
|
||||
|
||||
file { $ng_conf_d_dir:
|
||||
ensure => directory,
|
||||
path => $ng_conf_d_dir,
|
||||
owner => 'root',
|
||||
group => $ng_user,
|
||||
mode => '0750',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => nagios_etc_t,
|
||||
seluser => system_u,
|
||||
ensure => directory,
|
||||
path => $ng_conf_d_dir,
|
||||
owner => 'root',
|
||||
group => $ng_user,
|
||||
mode => '0750',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => nagios_etc_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
|
||||
# /etc/nagios/objects
|
||||
|
||||
file { $ng_objects_dir:
|
||||
ensure => directory,
|
||||
path => $ng_objects_dir,
|
||||
owner => 'root',
|
||||
group => $ng_user,
|
||||
mode => '0750',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => nagios_etc_t,
|
||||
seluser => system_u,
|
||||
ensure => directory,
|
||||
path => $ng_objects_dir,
|
||||
owner => 'root',
|
||||
group => $ng_user,
|
||||
mode => '0750',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => nagios_etc_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
|
||||
# /etc/nagios/private
|
||||
|
||||
file { $ng_private_dir:
|
||||
ensure => directory,
|
||||
path => $ng_private_dir,
|
||||
owner => 'root',
|
||||
group => $ng_user,
|
||||
mode => '0750',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => nagios_etc_t,
|
||||
seluser => system_u,
|
||||
ensure => directory,
|
||||
path => $ng_private_dir,
|
||||
owner => 'root',
|
||||
group => $ng_user,
|
||||
mode => '0750',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => nagios_etc_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
|
||||
# include dir
|
||||
|
||||
file { $ng_usr_incl:
|
||||
ensure => directory,
|
||||
path => $ng_usr_incl,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => usr_t,
|
||||
seluser => system_u,
|
||||
ensure => directory,
|
||||
path => $ng_usr_incl,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => usr_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
|
||||
# log dir
|
||||
|
||||
file { $ng_log_dir:
|
||||
ensure => directory,
|
||||
path => $ng_log_dir,
|
||||
owner => $ng_user,
|
||||
group => $ng_user,
|
||||
mode => '0750',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => nagios_log_t,
|
||||
seluser => system_u,
|
||||
ensure => directory,
|
||||
path => $ng_log_dir,
|
||||
owner => $ng_user,
|
||||
group => $ng_user,
|
||||
mode => '0750',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => nagios_log_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
|
||||
# log archives
|
||||
|
||||
file { $ng_log_archives:
|
||||
ensure => directory,
|
||||
path => $ng_log_archives,
|
||||
owner => $ng_user,
|
||||
group => $ng_user,
|
||||
mode => '0750',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => nagios_log_t,
|
||||
seluser => system_u,
|
||||
ensure => directory,
|
||||
path => $ng_log_archives,
|
||||
owner => $ng_user,
|
||||
group => $ng_user,
|
||||
mode => '0750',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => nagios_log_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
|
||||
# /usr/share/nagios
|
||||
|
||||
file { $ng_usr_share:
|
||||
ensure => directory,
|
||||
path => $ng_usr_share,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => usr_t,
|
||||
seluser => system_u,
|
||||
ensure => directory,
|
||||
path => $ng_usr_share,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => usr_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
|
||||
# /usr/share/nagios/html
|
||||
|
||||
file { $ng_share_html:
|
||||
ensure => directory,
|
||||
path => $ng_share_html,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => usr_t,
|
||||
seluser => system_u,
|
||||
ensure => directory,
|
||||
path => $ng_share_html,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => usr_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
|
||||
# run dir for pid file
|
||||
|
||||
file { $ng_run_dir:
|
||||
ensure => directory,
|
||||
path => $ng_run_dir,
|
||||
owner => 'nagios',
|
||||
group => 'nagios',
|
||||
mode => '0750',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => nagios_var_run_t,
|
||||
seluser => system_u,
|
||||
ensure => directory,
|
||||
path => $ng_run_dir,
|
||||
owner => 'nagios',
|
||||
group => 'nagios',
|
||||
mode => '0750',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => nagios_var_run_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
|
||||
# cmd dir
|
||||
|
||||
file { $ng_cmd_dir:
|
||||
ensure => directory,
|
||||
path => $ng_cmd_dir,
|
||||
owner => 'nagios',
|
||||
group => 'nagios',
|
||||
mode => '0775',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => nagios_spool_t,
|
||||
seluser => system_u,
|
||||
ensure => directory,
|
||||
path => $ng_cmd_dir,
|
||||
owner => 'nagios',
|
||||
group => 'nagios',
|
||||
mode => '0775',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => nagios_spool_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
|
||||
# checkresults dir
|
||||
|
||||
file { $ng_checkresults_dir:
|
||||
ensure => directory,
|
||||
path => $ng_checkresults_dir,
|
||||
owner => 'nagios',
|
||||
group => 'nagios',
|
||||
mode => '0770',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => nagios_spool_t,
|
||||
seluser => system_u,
|
||||
ensure => directory,
|
||||
path => $ng_checkresults_dir,
|
||||
owner => 'nagios',
|
||||
group => 'nagios',
|
||||
mode => '0770',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => nagios_spool_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,6 @@
|
||||
## cd_nagios::main::install.pp
|
||||
# Module name: cd_nagios
|
||||
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
|
||||
# # License:
|
||||
# This file is part of cd_nagios.
|
||||
#
|
||||
# cd_nagios is used for providing automatic configuration of Nagios.
|
||||
# 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 <http://www.gnu.org/licenses/>.
|
||||
# @summary Class manage all aspects of installing binaries required for
|
||||
# cd_nagios
|
||||
###############################################################################
|
||||
|
||||
@@ -1,49 +1,31 @@
|
||||
## cd_nagios::main::user.pp
|
||||
# Module name: cd_nagios
|
||||
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
|
||||
# # License:
|
||||
# This file is part of cd_nagios.
|
||||
#
|
||||
# cd_nagios is used for providing automatic configuration of Nagios
|
||||
# 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 <http://www.gnu.org/licenses/>.
|
||||
# @summary Class manages service users for cd_nagios.
|
||||
#############################################################################
|
||||
class cd_nagios::main::user (
|
||||
|
||||
) inherits cd_nagios::params {
|
||||
|
||||
require cd_nagios::main::install
|
||||
|
||||
group { $ng_user:
|
||||
ensure => present,
|
||||
name => $ng_user,
|
||||
gid => $ng_u_uid,
|
||||
allowdupe => false,
|
||||
ensure => present,
|
||||
name => $ng_user,
|
||||
gid => $ng_u_uid,
|
||||
allowdupe => false,
|
||||
}
|
||||
|
||||
user { $ng_user:
|
||||
ensure => present,
|
||||
name => $ng_user,
|
||||
allowdupe => false,
|
||||
comment => $ng_u_comment,
|
||||
uid => $ng_u_uid,
|
||||
gid => $ng_user,
|
||||
groups => $ng_u_groups,
|
||||
managehome => true,
|
||||
home => $ng_user_home,
|
||||
shell => $ng_user_shell,
|
||||
require => Group[$ng_user],
|
||||
user { $ng_user:
|
||||
ensure => present,
|
||||
name => $ng_user,
|
||||
allowdupe => false,
|
||||
comment => $ng_u_comment,
|
||||
uid => $ng_u_uid,
|
||||
gid => $ng_user,
|
||||
groups => $ng_u_groups,
|
||||
managehome => true,
|
||||
home => $ng_user_home,
|
||||
shell => $ng_user_shell,
|
||||
require => Group[$ng_user],
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user