Last active
December 1, 2017 18:56
-
-
Save binford2k/53ce944e73b2e633c1148a77ff6c3e60 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$versions = ['5.3.3', '4.9.0', '2.7.4', '3.6.2', '3.8.5' ] | |
# ... | |
if $versions { | |
$_versions = $versions.sort.reverse.join(', ') | |
$_packages = $versions.map |$version| { | |
"puppet:${version}" | |
}.join(' ') | |
exec { "gem install ${_packages} --bindir /tmp --no-document": | |
path => '/usr/local/bin:/usr/bin:/bin:/opt/puppetlabs/bin', | |
unless => "[[ \"$(gem list ^puppet$ | tail -1)\" == \"puppet (${_versions})\" ]]", | |
provider => shell, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment