Skip to content

Instantly share code, notes, and snippets.

@hartfordfive
Created July 8, 2016 16:23
Show Gist options
  • Select an option

  • Save hartfordfive/bd32dae4b8bed6dc77e27f4919aebec9 to your computer and use it in GitHub Desktop.

Select an option

Save hartfordfive/bd32dae4b8bed6dc77e27f4919aebec9 to your computer and use it in GitHub Desktop.
Easily specifying different packages based on OS in Chef
packages = value_for_platform_family(
%w(rhel fedora suse) => %w(pcre-devel),
%w(gentoo) => [],
%w(default) => %w(libpcre3 libpcre3-dev)
)
packages.each do |p|
package p do
action :install
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment