I have 3 different ways to install said package, and I prefer option #1 the most, but I wanted to see if there was a reason to use option #2 or 3 or any other options? (My goal of this question is to get feedback of different ways to do this; and not install at compile time if possible... in this case)
1st.
p = package "snmp" do
package_name value_for_platform(
[ "centos", "redhat", "suse" ] => { "default" => "net-snmp" },
"default" => "snmpd"
)
action :install
end
2nd.
packages = case node[:platform]
when "centos","redhat","fedora"
%w{net-snmp}
else
%w{snmpd}
end
packages.each do |pkg|
package pkg
end
3rd.
package "snmpd" do
action :install
only_if do platform?("ubuntu", "debian") end
end