Skip to content

Instantly share code, notes, and snippets.

@eherot
Created June 12, 2012 13:50
Show Gist options
  • Save eherot/2917622 to your computer and use it in GitHub Desktop.
Save eherot/2917622 to your computer and use it in GitHub Desktop.
Run only if package installed
packagename="PACKAGE"
case node["platform"]
when "debian","ubuntu"
pkg_chk_cmd="dpkg -s #{packagename}"
when "redhat","centos","fedora","amazon","scientific"
pkg_chk_cmd="yum list installed #{packagename}"
end
if `#{pkg_chk_cmd}`
DO_OTHER_STUFF
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment