Modify packages to work with current ami. #77

Closed
wants to merge 2 commits into from

4 participants

@brownjohnf

For some reason, there's a mismatch here between what's actually available in the sources. This fixes the problem.

@karmi
elastic member

Thanks! This is most probably due to half-baked package definition in e8fec8a, it's only valid for Debian/Ubuntu, I guess.

I won't be able to get to this in the next couple of days -- would it be possible you add support for other distros to the value_for_platform declaration (debian, ubuntu, amazon, centos, rhel, etc), and test it eg. with Vagrant? Could you possibly coordinate with @zsiddique who wrote the original support?

@brownjohnf

Yeah, I'll take look and come up with something.

@zsiddique

opps :trollface:

Yeah I guess I got caught up with the Ubuntu only aspect and forgot about the other distros. Can add some protection code so its only on debian machines and let others who use rhel and etc come up with the packages required for those

@karmi
elastic member

@zsiddique The package names will be only slightly different on Rhel and variants, as @brownjohnf discovered. We should be able to support any distro in this aspect, I think it's just a matter of naming.

@brownjohnf

I'm not sure what the best way is to handle this. There doesn't appear to be an effective way of reliably determining across all systems. Do you think that /etc/*release is good enough?

@karmi
elastic member

@brownjohnf value_for_platform expects just generic names ("ubuntu", "debian", "amazon", "centos", "rhel", etc) -- don't get crazy with trying to support any distro out there or something like that! :) The improvement with this approach will be that anybody who hits missing platform/bad value, etc, can easily add it and send us a pull request.

@brownjohnf

@karmi So are you saying something as simple as this works?:

value_for_platform(
  'default' => %w|libxslt-devel libxml2-devel|,
  'debian'  => %w|libxslt-devel libxml2-devel|,
  'ubuntu'  => %w|libxslt-dev libxml2-dev|,
).each do |pkg|

I just took a quick glance at some docs on opscode, and it seems like this is what they're saying.

@karmi
elastic member

Absolutely!, I'd just add suse, centos, redhat, amazon (= redhat, in effect)

@brownjohnf

@karmi Great. I should have it done today.

@karmi
elastic member

Very cool! Will test it against ubuntu + centos in the bundle Vagrant support then!

@zsiddique

According to http://nokogiri.org/tutorials/installing_nokogiri.html debian and ubuntu should be the same, | libxslt-dev libxml2-dev | and rhel is libxslt-devel libxml2-devel.

@brownjohnf

That's basically what I came up with. The Debian crowd use -dev, and the rest use -devel.

@tacchino

I think you want something more like this

value_for_platform(
["default", "centos", "redhat", "suse", "fedora", "amazon" ] => {
"default" => %w[libxslt-devel libxml2-devel]
},
["ubuntu", "debian"] => {
"default" => %w[libxslt-dev libxml2-dev]
}

@karmi
elastic member

@tacchino True, but I think using value_for_platform_family would make it more concise. (And it's supported on Chef 10 as well.)

@karmi karmi added a commit that closed this pull request Mar 18, 2013
@brownjohnf brownjohnf Fix incorrect names for packages in recipes/ebs
Use `value_for_platform` to with platform-specific package names for libxslt and libxml

Closes #77
e38fdfd
@karmi karmi closed this in e38fdfd Mar 18, 2013
@karmi karmi added a commit that referenced this pull request Mar 18, 2013
@karmi karmi [#77] Added `build-essential` into Vagrantfile and recipes/ebs
NOTE: Even though the "build-essential" cookbook is included in the node `run_list`,
`build-essential` is not installed and `make` is not available before the Chef run,
making the installation of the Fog gem fail.

That's why we need to include the build-essential/make/gcc/etc packages also in the
`value_for_platform_family` in recipes/ebs.
15c4e13
@karmi
elastic member

Hi, merged & pushed, thanks! Used value_for_platform_family in the end (see attached commit), verified locally with Chef Solo via Vagrant on Ubuntu 12.04 and CentOS 6, verified with Chef Server on Ubuntu 12.04 and Amazon Linux in EC2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment