Skip to content

Commit

Permalink
Make addons recognize a version string
Browse files Browse the repository at this point in the history
  • Loading branch information
bsg-sfrazer committed Oct 9, 2019
1 parent 2702436 commit 5cc2f38
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions manifests/addon.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#
define splunk::addon (
Optional[Stdlib::Absolutepath] $splunk_home = undef,
Optional[String[1]] $version = undef,
Boolean $package_manage = true,
Optional[String[1]] $splunkbase_source = undef,
Optional[String[1]] $package_name = undef,
Expand Down Expand Up @@ -70,6 +71,12 @@

if $package_manage {
if $splunkbase_source {

if $version {
$addon_creates = "${_splunk_home}/etc/apps/${name}/manifest-${version}"
} else {
$addon_creates = "${_splunk_home}/etc/apps/${name}"
}
$archive_name = $splunkbase_source.split('/')[-1]
archive { $name:
path => "${splunk::params::staging_dir}/${archive_name}",
Expand All @@ -78,7 +85,7 @@
source => $splunkbase_source,
extract => true,
extract_path => "${_splunk_home}/etc/apps",
creates => "${_splunk_home}/etc/apps/${name}",
creates => "${addon_creates}",
cleanup => true,
before => File["${_splunk_home}/etc/apps/${name}/local"],
}
Expand Down Expand Up @@ -122,4 +129,3 @@
}
}
}

0 comments on commit 5cc2f38

Please sign in to comment.