Skip to content

Instantly share code, notes, and snippets.

@gchaix
Last active December 31, 2015 13:19
Show Gist options
  • Save gchaix/7992260 to your computer and use it in GitHub Desktop.
Save gchaix/7992260 to your computer and use it in GitHub Desktop.
Conditional package naming in puppet
$updatecommand = $osfamily ? {
'Debian' => 'apt-get update && apt-get upgrade',
'RedHat' => 'yum update',
'Suse' => 'zypper update',
}
exec { "update_packages":
command => $updatecommand,
path => "/usr/local/bin/:/bin/",
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment