bernd / fpm-cookery

A tool for building software packages with fpm.
Other
460 stars 88 forks source link

allow usage of newer (currently 5.5.x) puppet version #201

Closed lukasz-e closed 5 years ago

lukasz-e commented 6 years ago

(First of all - I found fpm-cookery (along with fpm) very great piece of software and I hope it will ease my headache "how to build custom rpm/deb for ~15 different linux platforms".)

Currently fpm-cookery has very conservative restriction for puppet version (~>3.4), which means 3.8.x and nothing more ever - as 3.x line is dead. That old puppet suffers from several problems on newer environments (e.g. https://tickets.puppetlabs.com/browse/PUP-7383, but I also encountered others), resolving them means ugly (mokey-)patching of puppet every time :(

As i checked, ftp-cookery has no problem using latest currently available puppets (5.5.x), there are only minor problems with newer hiera (which is pulled as new puppet's dependency).

So what I am proposing here:

  1. relax puppet version requirement to >=3.4, <6.0 (seems to be safe now)
  2. apply fixes needed by hiera >= 2:
    • add #include? method in FPM::Cookery::Hiera::Scope (hiera calls it now despite docs says nothing about it...)
    • in FPM::Cookery::Hiera::Instance#lookup for newer hiera (>=2.0.0) don't call lookup with symbol as key value. Hiera currently expects only String there (as docs says) and passing symbol triggers errors from inside of hiera code. I don't fully understand reason for dual "symbol/String" lookup call from FPM::Cookery::Hiera::Instance#lookup - so I left dual version for old (<2.0.0) hieras and "String only" for newer (>=2.0.0) based on detected hiera version.

(All changes in PR works for my packages and passes all tests in fpm-cookery)