Skip to content

Instantly share code, notes, and snippets.

@coderforhire
Created May 8, 2013 21:30
Show Gist options
  • Save coderforhire/5543814 to your computer and use it in GitHub Desktop.
Save coderforhire/5543814 to your computer and use it in GitHub Desktop.
def version
Puppet.info("Entering Version")
package = resource[:package_list].first
package = package.to_s
Puppet.info("#{package}")
version = rpm('-q', package)
if version =~ /^#{Regexp.escape(package)}-(.*)(.*)/
Puppet.info("#{$1}")
$1
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment