OP#421 fix installation section
This commit is contained in:
@@ -6,52 +6,9 @@
|
|||||||
class confdroid_nagios::main::dirs (
|
class confdroid_nagios::main::dirs (
|
||||||
|
|
||||||
) inherits confdroid_nagios::params {
|
) inherits confdroid_nagios::params {
|
||||||
if $ng_nagios_server == $fqdn {
|
|
||||||
require confdroid_nagios::main::user
|
require confdroid_nagios::main::user
|
||||||
|
if $ng_nagios_server == $fqdn {
|
||||||
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
|
# /etc/nagios/conf.d
|
||||||
|
|
||||||
file { $ng_conf_d_dir:
|
file { $ng_conf_d_dir:
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
path => $ng_conf_d_dir,
|
path => $ng_conf_d_dir,
|
||||||
@@ -204,5 +161,45 @@ class confdroid_nagios::main::dirs (
|
|||||||
seluser => system_u,
|
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,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ class confdroid_nagios::main::install (
|
|||||||
require confdroid_resources
|
require confdroid_resources
|
||||||
# if our FQDN matches the configured Nagios server FQDN, install both server-
|
# if our FQDN matches the configured Nagios server FQDN, install both server-
|
||||||
# and client packages.
|
# and client packages.
|
||||||
if $fqdn == $ng_nagios_server {
|
|
||||||
# we'll need httpd installed
|
# we'll need httpd installed
|
||||||
require confdroid_apache
|
require confdroid_apache
|
||||||
|
|
||||||
@@ -21,5 +20,18 @@ class confdroid_nagios::main::install (
|
|||||||
ensure => $ng_pkg_ensure,
|
ensure => $ng_pkg_ensure,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 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 $ng_include_nrpe == true {
|
||||||
|
require cd_nrpe
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user