Skip to content

Commit 040af11

Browse files
authored
Modify the type of archive depending on release version
All versions before and including v1.0.0 are packaged in 'gz' archives, however, versions coming afterwards, such as v1.1.0 and further are packages in 'zip'.
1 parent e30cd05 commit 040af11

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

manifests/install.pp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,19 @@
1717
$version_dir = "${data_dir}/promtail-${promtail::version}"
1818
$binary_path = "${version_dir}/${release_file_name}"
1919

20+
if versioncmp($promtail::version, 'v1.0.0') > 0 {
21+
$archive_type = 'zip'
22+
} else {
23+
$archive_type = 'gz'
24+
}
25+
2026
file { [$data_dir, $version_dir]:
2127
ensure => directory,
2228
}
2329

2430
archive { "${binary_path}.gz":
2531
ensure => present,
26-
source => "https://github.com/grafana/loki/releases/download/${promtail::version}/${release_file_name}.gz",
32+
source => "https://github.com/grafana/loki/releases/download/${promtail::version}/${release_file_name}.${archive_type}",
2733
extract => true,
2834
extract_path => $version_dir,
2935
creates => $binary_path,

0 commit comments

Comments
 (0)