OP#421 restructure
This commit is contained in:
@@ -6,8 +6,48 @@
|
||||
class confdroid_nagios::main::dirs (
|
||||
|
||||
) inherits confdroid_nagios::params {
|
||||
require confdroid_nagios::main::user
|
||||
if $ng_nagios_server == $fqdn {
|
||||
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,
|
||||
}
|
||||
|
||||
# /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,
|
||||
}
|
||||
|
||||
# /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,
|
||||
}
|
||||
|
||||
if $fqdn == $ng_nagios_server {
|
||||
# /etc/nagios/conf.d
|
||||
file { $ng_conf_d_dir:
|
||||
ensure => directory,
|
||||
@@ -22,7 +62,6 @@ class confdroid_nagios::main::dirs (
|
||||
}
|
||||
|
||||
# /etc/nagios/objects
|
||||
|
||||
file { $ng_objects_dir:
|
||||
ensure => directory,
|
||||
path => $ng_objects_dir,
|
||||
@@ -36,7 +75,6 @@ class confdroid_nagios::main::dirs (
|
||||
}
|
||||
|
||||
# /etc/nagios/private
|
||||
|
||||
file { $ng_private_dir:
|
||||
ensure => directory,
|
||||
path => $ng_private_dir,
|
||||
@@ -47,10 +85,9 @@ class confdroid_nagios::main::dirs (
|
||||
selrole => object_r,
|
||||
seltype => nagios_etc_t,
|
||||
seluser => system_u,
|
||||
}
|
||||
}
|
||||
|
||||
# include dir
|
||||
|
||||
file { $ng_usr_incl:
|
||||
ensure => directory,
|
||||
path => $ng_usr_incl,
|
||||
@@ -64,7 +101,6 @@ class confdroid_nagios::main::dirs (
|
||||
}
|
||||
|
||||
# log dir
|
||||
|
||||
file { $ng_log_dir:
|
||||
ensure => directory,
|
||||
path => $ng_log_dir,
|
||||
@@ -78,7 +114,6 @@ class confdroid_nagios::main::dirs (
|
||||
}
|
||||
|
||||
# log archives
|
||||
|
||||
file { $ng_log_archives:
|
||||
ensure => directory,
|
||||
path => $ng_log_archives,
|
||||
@@ -92,7 +127,6 @@ class confdroid_nagios::main::dirs (
|
||||
}
|
||||
|
||||
# /usr/share/nagios
|
||||
|
||||
file { $ng_usr_share:
|
||||
ensure => directory,
|
||||
path => $ng_usr_share,
|
||||
@@ -106,7 +140,6 @@ class confdroid_nagios::main::dirs (
|
||||
}
|
||||
|
||||
# /usr/share/nagios/html
|
||||
|
||||
file { $ng_share_html:
|
||||
ensure => directory,
|
||||
path => $ng_share_html,
|
||||
@@ -120,7 +153,6 @@ class confdroid_nagios::main::dirs (
|
||||
}
|
||||
|
||||
# run dir for pid file
|
||||
|
||||
file { $ng_run_dir:
|
||||
ensure => directory,
|
||||
path => $ng_run_dir,
|
||||
@@ -134,7 +166,6 @@ class confdroid_nagios::main::dirs (
|
||||
}
|
||||
|
||||
# cmd dir
|
||||
|
||||
file { $ng_cmd_dir:
|
||||
ensure => directory,
|
||||
path => $ng_cmd_dir,
|
||||
@@ -148,7 +179,6 @@ class confdroid_nagios::main::dirs (
|
||||
}
|
||||
|
||||
# checkresults dir
|
||||
|
||||
file { $ng_checkresults_dir:
|
||||
ensure => directory,
|
||||
path => $ng_checkresults_dir,
|
||||
@@ -161,45 +191,4 @@ class confdroid_nagios::main::dirs (
|
||||
seluser => system_u,
|
||||
}
|
||||
}
|
||||
else {
|
||||
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,
|
||||
}
|
||||
|
||||
# /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,
|
||||
}
|
||||
|
||||
# /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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,7 @@ class confdroid_nagios::main::install (
|
||||
if $ng_nagios_server == $fqdn {
|
||||
require confdroid_resources
|
||||
# if our FQDN matches the configured Nagios server FQDN, install both server-
|
||||
# and client packages.
|
||||
# we'll need httpd installed
|
||||
# and client packages.We'll need httpd installed
|
||||
require confdroid_apache
|
||||
|
||||
package { $ng_reqpackages_server:
|
||||
@@ -22,14 +21,12 @@ class confdroid_nagios::main::install (
|
||||
}
|
||||
|
||||
# if we are not the nagios server, install only client packages
|
||||
|
||||
if $fqdn != $ng_nagios_server {
|
||||
package { $reqpackages_client:
|
||||
ensure => $pkg_ensure,
|
||||
}
|
||||
|
||||
# if we want to use NRPE, install it
|
||||
|
||||
# if we want to use NRPE on clients, install it
|
||||
if $ng_include_nrpe == true {
|
||||
require cd_nrpe
|
||||
}
|
||||
|
||||
@@ -6,15 +6,14 @@
|
||||
class confdroid_nagios::main::user (
|
||||
|
||||
) inherits confdroid_nagios::params {
|
||||
require confdroid_nagios::main::install
|
||||
if $ng_nagios_server == $fqdn {
|
||||
require confdroid_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,
|
||||
|
||||
Reference in New Issue
Block a user