Skip to content

Commit

Permalink
Merge pull request #9 from jsosic/add-release-to-ver
Browse files Browse the repository at this point in the history
Add support for release in to package version
  • Loading branch information
jdavisp3 authored Nov 2, 2022
2 parents 9c9e4f1 + 144b92b commit 46bfbfa
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
}

# The version of Vagrant to install.
$version = lookup('vagrant::version', { default_value => '2.2.5' })
$version = lookup('vagrant::version', { default_value => '2.3.2-1' })

# Where to cache Vagrant package downloads, if necessary.
$cache = '/var/cache/vagrant'

$version_without_release = split($version,'-')[0]

case $facts['os']['family'] {
'Darwin': {
$package = "vagrant-${version}"
Expand All @@ -37,7 +39,11 @@
}
'RedHat': {
$package = 'vagrant'
$package_basename = "vagrant_${version}_${arch}.rpm"
if versioncmp($version_without_release, '2.3') >= 0 {
$package_basename = "vagrant-${version}.${arch}.rpm"
} else {
$package_basename = "vagrant_${version}_${arch}.rpm"
}
$provider = 'rpm'
$download = true
}
Expand All @@ -51,5 +57,5 @@
'vagrant::package_url',
{ default_value => 'https://releases.hashicorp.com/vagrant/' }
)
$package_url = "${base_url}${version}/${package_basename}"
$package_url = "${base_url}${version_without_release}/${package_basename}"
}

0 comments on commit 46bfbfa

Please sign in to comment.