Skip to content

Commit

Permalink
Merge pull request #565 from syseleven/feature/add_data_type_userpara…
Browse files Browse the repository at this point in the history
…meters

Add data types for zabbix::userparameters
  • Loading branch information
bastelfreak authored Dec 21, 2018
2 parents f08c9db + 95dc9b2 commit dff5841
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions manifests/userparameters.pp
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@
# Copyright 2014 Werner Dijkerman
#
define zabbix::userparameters (
$source = '',
$content = '',
$script = '',
$script_ext = '',
$template = '',
$script_dir = '/usr/bin',
$config_mode = '0644',
Optional[Stdlib::Filesource] $source = undef,
Optional[String[1]] $content = undef,
Optional[Stdlib::Filesource] $script = undef,
Optional[String[1]] $script_ext = undef,
Optional[String[1]] $template = undef,
Stdlib::Absolutepath $script_dir = '/usr/bin',
Stdlib::Filemode $config_mode = '0644',
) {
include zabbix::agent
$include_dir = $zabbix::agent::include_dir
Expand All @@ -72,7 +72,7 @@
$agent_config_group = $zabbix::agent::agent_config_group
$agent_servicename = $zabbix::agent::agent_servicename

if $source != '' {
if $source {
file { "${include_dir}/${name}.conf":
ensure => present,
owner => $agent_config_owner,
Expand All @@ -84,7 +84,7 @@
}
}

if $content != '' {
if $content {
file { "${include_dir}/${name}.conf":
ensure => present,
owner => $agent_config_owner,
Expand All @@ -96,7 +96,7 @@
}
}

if $script != '' {
if $script {
file { "${script_dir}/${name}${script_ext}":
ensure => present,
owner => $agent_config_owner,
Expand All @@ -111,7 +111,7 @@
# If template is defined, it means we have an template in zabbix
# which needs to be loaded for this host. When exported resources is
# used/enabled, we do this automatically.
if $template != '' {
if $template {
zabbix::resources::userparameters { "${facts['hostname']}_${name}":
hostname => $facts['fqdn'],
template => $template,
Expand Down

0 comments on commit dff5841

Please sign in to comment.