Skip to content

Commit

Permalink
Merge pull request voxpupuli#241 from ody/addon_user_group
Browse files Browse the repository at this point in the history
Set user and group for addon installation
  • Loading branch information
bastelfreak authored Jun 12, 2019
2 parents 067a7d4 + c0e9ef9 commit ef70a6f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion manifests/addon.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
# @param package_name
# The OS package to install if you are not installing via splunk compatible archive
#
# @param owner
# The user that files are owned by when they are created as part of add-on installation
#
# @param inputs
# A hash of inputs to be configured as part of add-on installation, alterntively you can also define splunk_input or splunkforwarder_input resouces seperately
#
Expand All @@ -42,6 +45,7 @@
Boolean $package_manage = true,
Optional[String[1]] $splunkbase_source = undef,
Optional[String[1]] $package_name = undef,
String[1] $owner = 'splunk',
Hash $inputs = {},
) {

Expand Down Expand Up @@ -69,6 +73,8 @@
$archive_name = $splunkbase_source.split('/')[-1]
archive { $name:
path => "${splunk::params::staging_dir}/${archive_name}",
user => $owner,
group => $owner,
source => $splunkbase_source,
extract => true,
extract_path => "${_splunk_home}/etc/apps",
Expand All @@ -84,7 +90,11 @@
}
}

file { "${_splunk_home}/etc/apps/${name}/local": ensure => directory }
file { "${_splunk_home}/etc/apps/${name}/local":
ensure => directory,
owner => $owner,
group => $owner,
}

$inputs.each |$section, $attributes| {
$attributes.each |$setting, $value| {
Expand Down

0 comments on commit ef70a6f

Please sign in to comment.