Added refresh_icinga2_service parameters to each of the object defined types so that they can be used by themselves if the module isn't being used to also manage the Icinga 2 service.
refs# 7856 : https://dev.icinga.org/issues/7856
This commit is contained in:
parent
6ce20b8d1a
commit
251184b944
27 changed files with 782 additions and 231 deletions
|
@ -28,7 +28,9 @@ define icinga2::object::apply_dependency (
|
|||
$target_file_ensure = file,
|
||||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644') {
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
# Do some validation of the class' parameters:
|
||||
validate_string($object_name)
|
||||
validate_string($display_name)
|
||||
|
@ -46,16 +48,35 @@ define icinga2::object::apply_dependency (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_string($target_file_mode)
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
validate_re($object_type, ['^Host', '^Service'])
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_apply_dependency.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_apply_dependency.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -29,7 +29,8 @@ define icinga2::object::apply_notification_to_host (
|
|||
$target_file_ensure = file,
|
||||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644'
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation of the class' parameters:
|
||||
|
@ -53,6 +54,10 @@ define icinga2::object::apply_notification_to_host (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_re($target_file_mode, '^\d{4}$')
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -60,6 +65,22 @@ define icinga2::object::apply_notification_to_host (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_apply_notification_to_host.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_apply_notification_to_host.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -30,7 +30,8 @@ define icinga2::object::apply_notification_to_service (
|
|||
$target_file_ensure = file,
|
||||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644'
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation of the class' parameters:
|
||||
|
@ -55,6 +56,10 @@ define icinga2::object::apply_notification_to_service (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_re($target_file_mode, '^\d{4}$')
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -62,6 +67,22 @@ define icinga2::object::apply_notification_to_service (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_apply_notification_to_service.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_apply_notification_to_service.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -43,7 +43,8 @@ define icinga2::object::apply_service_to_host (
|
|||
$target_file_ensure = file,
|
||||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644'
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation of the class' parameters:
|
||||
|
@ -56,7 +57,10 @@ define icinga2::object::apply_service_to_host (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_string($target_file_mode)
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -64,7 +68,22 @@ define icinga2::object::apply_service_to_host (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_apply_service_to_host.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_apply_service_to_host.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ define icinga2::object::checkcommand (
|
|||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation of the class' parameters:
|
||||
|
@ -50,8 +51,11 @@ define icinga2::object::checkcommand (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_re($target_file_mode, '^\d{4}$')
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
if $checkcommand_file_distribution_method == 'content' {
|
||||
file {"${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -78,3 +82,34 @@ define icinga2::object::checkcommand (
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
if $checkcommand_file_distribution_method == 'content' {
|
||||
file {"${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template("${checkcommand_template_module}/${checkcommand_template}"),
|
||||
}
|
||||
}
|
||||
elsif $checkcommand_file_distribution_method == 'source' {
|
||||
file {"${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
source => $checkcommand_source_file,
|
||||
}
|
||||
}
|
||||
else {
|
||||
notify {'Missing/Incorrect File Distribution Method':
|
||||
message => 'The parameter checkcommand_file_distribution_method is missing or incorrect. Please set content or source',
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,7 +18,8 @@ define icinga2::object::checkresultreader (
|
|||
$target_file_ensure = file,
|
||||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644'
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation of the class' parameters:
|
||||
|
@ -33,7 +34,10 @@ define icinga2::object::checkresultreader (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_re($target_file_mode, '^\d{4}$')
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -41,7 +45,22 @@ define icinga2::object::checkresultreader (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_checkresultreader.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_checkresultreader.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,8 @@ define icinga2::object::compatlogger (
|
|||
$target_file_ensure = file,
|
||||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644'
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation of the class' parameters:
|
||||
|
@ -37,7 +38,10 @@ define icinga2::object::compatlogger (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_re($target_file_mode, '^\d{4}$')
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -45,7 +49,22 @@ define icinga2::object::compatlogger (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_compatlogger.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_compatlogger.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,7 +25,9 @@ define icinga2::object::dependency (
|
|||
$target_file_ensure = file,
|
||||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644') {
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
# Do some validation of the class' parameters:
|
||||
validate_string($object_name)
|
||||
validate_string($display_name)
|
||||
|
@ -43,6 +45,10 @@ define icinga2::object::dependency (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_string($target_file_mode)
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -50,7 +56,22 @@ define icinga2::object::dependency (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_dependency.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_dependency.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,8 @@ define icinga2::object::eventcommand (
|
|||
$target_file_ensure = file,
|
||||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644'
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation of the class' parameters:
|
||||
|
@ -43,7 +44,10 @@ define icinga2::object::eventcommand (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_re($target_file_mode, '^\d{4}$')
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -51,8 +55,23 @@ define icinga2::object::eventcommand (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_eventcommand.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_eventcommand.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,8 @@ define icinga2::object::externalcommandlistener (
|
|||
$target_file_ensure = file,
|
||||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644'
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation of the class' parameters:
|
||||
|
@ -33,7 +34,10 @@ define icinga2::object::externalcommandlistener (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_re($target_file_mode, '^\d{4}$')
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -41,7 +45,22 @@ define icinga2::object::externalcommandlistener (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_externalcommandlistener.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_externalcommandlistener.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,11 +19,16 @@ define icinga2::object::graphitewriter (
|
|||
$target_file_ensure = file,
|
||||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644'
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation
|
||||
validate_string($host)
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -31,6 +36,22 @@ define icinga2::object::graphitewriter (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_graphitewriter.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_graphitewriter.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -42,7 +42,8 @@ define icinga2::object::host (
|
|||
$target_file_ensure = file,
|
||||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644'
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation of the class' parameters:
|
||||
|
@ -57,6 +58,10 @@ define icinga2::object::host (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_string($target_file_mode)
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -64,7 +69,22 @@ define icinga2::object::host (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_host.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_host.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,7 +21,8 @@ define icinga2::object::hostgroup (
|
|||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644',
|
||||
$assign_where = undef,
|
||||
$ignore_where = undef
|
||||
$ignore_where = undef,
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation of the class' parameters:
|
||||
|
@ -34,6 +35,10 @@ define icinga2::object::hostgroup (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_string($target_file_mode)
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -41,7 +46,22 @@ define icinga2::object::hostgroup (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_hostgroup.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_hostgroup.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -42,7 +42,8 @@ define icinga2::object::idomysqlconnection (
|
|||
$target_file_name = "${name}.conf",
|
||||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644'
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation of the class' parameters:
|
||||
|
@ -61,6 +62,10 @@ define icinga2::object::idomysqlconnection (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_string($target_file_mode)
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -68,7 +73,22 @@ define icinga2::object::idomysqlconnection (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_idomysqlconnection.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_idomysqlconnection.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -42,7 +42,8 @@ define icinga2::object::idopgsqlconnection (
|
|||
$target_file_ensure = file,
|
||||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644'
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation of the class' parameters:
|
||||
|
@ -61,6 +62,10 @@ define icinga2::object::idopgsqlconnection (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_string($target_file_mode)
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -68,7 +73,22 @@ define icinga2::object::idopgsqlconnection (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_idopgsqlconnection.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_idopgsqlconnection.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,7 +21,8 @@ define icinga2::object::livestatuslistener (
|
|||
$target_file_ensure = file,
|
||||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644'
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation of the class' parameters:
|
||||
|
@ -48,7 +49,10 @@ define icinga2::object::livestatuslistener (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_re($target_file_mode, '^\d{4}$')
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -56,7 +60,22 @@ define icinga2::object::livestatuslistener (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_livestatuslistener.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_livestatuslistener.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -27,7 +27,8 @@ define icinga2::object::notification (
|
|||
$target_file_ensure = file,
|
||||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644'
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation of the class' parameters:
|
||||
|
@ -66,7 +67,10 @@ define icinga2::object::notification (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_re($target_file_mode, '^\d{4}$')
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -74,7 +78,22 @@ define icinga2::object::notification (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_notification.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_notification.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,8 @@ define icinga2::object::notificationcommand (
|
|||
$target_file_ensure = file,
|
||||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644'
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation of the class' parameters:
|
||||
|
@ -43,7 +44,10 @@ define icinga2::object::notificationcommand (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_re($target_file_mode, '^\d{4}$')
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -51,7 +55,22 @@ define icinga2::object::notificationcommand (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_notificationcommand.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_notificationcommand.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,8 @@ define icinga2::object::perfdatawriter (
|
|||
$target_file_ensure = file,
|
||||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644'
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation of the class' parameters:
|
||||
|
@ -57,7 +58,10 @@ define icinga2::object::perfdatawriter (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_re($target_file_mode, '^\d{4}$')
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -65,7 +69,22 @@ define icinga2::object::perfdatawriter (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_perfdatawriter.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_perfdatawriter.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,7 +23,8 @@ define icinga2::object::scheduleddowntime (
|
|||
$target_file_ensure = file,
|
||||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644'
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation of the define's parameters:
|
||||
|
@ -42,6 +43,10 @@ define icinga2::object::scheduleddowntime (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_string($target_file_mode)
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -49,7 +54,22 @@ define icinga2::object::scheduleddowntime (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_scheduleddowntime.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_scheduleddowntime.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -41,7 +41,8 @@ define icinga2::object::service (
|
|||
$target_file_ensure = file,
|
||||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644'
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation of the class' parameters:
|
||||
|
@ -56,6 +57,10 @@ define icinga2::object::service (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_string($target_file_mode)
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -63,7 +68,22 @@ define icinga2::object::service (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_service.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_service.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,7 +21,8 @@ define icinga2::object::servicegroup (
|
|||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644',
|
||||
$assign_where = undef,
|
||||
$ignore_where = undef
|
||||
$ignore_where = undef,
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation of the class' parameters:
|
||||
|
@ -34,6 +35,10 @@ define icinga2::object::servicegroup (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_string($target_file_mode)
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -41,7 +46,22 @@ define icinga2::object::servicegroup (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_servicegroup.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_servicegroup.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,8 @@ define icinga2::object::statusdatawriter (
|
|||
$target_file_ensure = file,
|
||||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644'
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation of the class' parameters:
|
||||
|
@ -40,7 +41,10 @@ define icinga2::object::statusdatawriter (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_re($target_file_mode, '^\d{4}$')
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -48,7 +52,22 @@ define icinga2::object::statusdatawriter (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_statusdatawriter.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_statusdatawriter.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,7 +17,8 @@ define icinga2::object::sysloglogger (
|
|||
$target_file_ensure = file,
|
||||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644'
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation of the class' parameters:
|
||||
|
@ -28,6 +29,10 @@ define icinga2::object::sysloglogger (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_string($target_file_mode)
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -35,7 +40,22 @@ define icinga2::object::sysloglogger (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_sysloglogger.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_sysloglogger.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,12 +15,13 @@ define icinga2::object::timeperiod (
|
|||
$timeperiod_display_name = undef,
|
||||
$methods = undef,
|
||||
$ranges = {},
|
||||
$timeperiod_target_dir = '/etc/icinga2/objects/timeperiods',
|
||||
$timeperiod_target_file_name = "${name}.conf",
|
||||
$target_dir = '/etc/icinga2/objects/timeperiods',
|
||||
$target_file_name = "${name}.conf",
|
||||
$target_file_ensure = file,
|
||||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
# Do some validation of the class' parameters:
|
||||
|
@ -36,13 +37,33 @@ define icinga2::object::timeperiod (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_re($target_file_mode, '^\d{4}$')
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
file {"${timeperiod_target_dir}/${timeperiod_target_file_name}":
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_timeperiod.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_timeperiod.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,7 +25,8 @@ define icinga2::object::user (
|
|||
$target_file_ensure = file,
|
||||
$target_file_owner = 'root',
|
||||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644'
|
||||
$target_file_mode = '0644',
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation of the class' parameters:
|
||||
|
@ -41,6 +42,10 @@ define icinga2::object::user (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_string($target_file_mode)
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -48,7 +53,22 @@ define icinga2::object::user (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_user.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_user.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,7 +21,8 @@ define icinga2::object::usergroup (
|
|||
$target_file_group = 'root',
|
||||
$target_file_mode = '0644',
|
||||
$assign_where = undef,
|
||||
$ignore_where = undef
|
||||
$ignore_where = undef,
|
||||
$refresh_icinga2_service = true
|
||||
) {
|
||||
|
||||
#Do some validation of the class' parameters:
|
||||
|
@ -33,6 +34,10 @@ define icinga2::object::usergroup (
|
|||
validate_string($target_file_owner)
|
||||
validate_string($target_file_group)
|
||||
validate_string($target_file_mode)
|
||||
validate_bool($refresh_icinga2_service)
|
||||
|
||||
#If the refresh_icinga2_service parameter is set to true...
|
||||
if $refresh_icinga2_service == true {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
|
@ -40,7 +45,22 @@ define icinga2::object::usergroup (
|
|||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_usergroup.conf.erb'),
|
||||
#...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file...
|
||||
notify => Service['icinga2'],
|
||||
}
|
||||
|
||||
}
|
||||
#...otherwise, use the same file resource but without a notify => parameter:
|
||||
else {
|
||||
|
||||
file { "${target_dir}/${target_file_name}":
|
||||
ensure => $target_file_ensure,
|
||||
owner => $target_file_owner,
|
||||
group => $target_file_group,
|
||||
mode => $target_file_mode,
|
||||
content => template('icinga2/object_usergroup.conf.erb'),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue