Skip to content

Commit

Permalink
Merge pull request #400 from kBite/owner-and-group-via-params
Browse files Browse the repository at this point in the history
define owner and group via parameters
  • Loading branch information
bastelfreak authored Jun 7, 2017
2 parents 0970328 + 54deef4 commit de06aec
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions manifests/userparameters.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# == Define: zabbix::userparameters
#
# This will install an userparameters file with keys for item that can be check
# This will install an userparameters file with keys for items that can be checked
# with zabbix.
#
# === Requirements
Expand Down Expand Up @@ -61,41 +61,43 @@
$script_dir = '/usr/bin',
) {
$include_dir = getvar('::zabbix::agent::include_dir')
$zabbix_agent_package = getvar('::zabbix::agent::zabbix_package_agent')
$zabbix_package_agent = getvar('::zabbix::agent::zabbix_package_agent')
$agent_config_owner = getvar('::zabbix::agent::agent_config_owner')
$agent_config_group = getvar('::zabbix::agent::agent_config_group')

if $source != '' {
file { "${include_dir}/${name}.conf":
ensure => present,
owner => 'zabbix',
group => 'zabbix',
owner => $agent_config_owner,
group => $agent_config_group,
mode => '0644',
source => $source,
notify => Service['zabbix-agent'],
require => Package[$zabbix_agent_package],
require => Package[$zabbix_package_agent],
}
}

if $content != '' {
file { "${include_dir}/${name}.conf":
ensure => present,
owner => 'zabbix',
group => 'zabbix',
owner => $agent_config_owner,
group => $agent_config_group,
mode => '0644',
content => $content,
notify => Service['zabbix-agent'],
require => Package[$zabbix_agent_package],
require => Package[$zabbix_package_agent],
}
}

if $script != '' {
file { "${script_dir}/${name}${script_ext}":
ensure => present,
owner => 'zabbix',
group => 'zabbix',
owner => $agent_config_owner,
group => $agent_config_group,
mode => '0755',
source => $script,
notify => Service['zabbix-agent'],
require => Package[$zabbix_agent_package],
require => Package[$zabbix_package_agent],
}
}

Expand Down

0 comments on commit de06aec

Please sign in to comment.