简体   繁体   中英

Nokogiri / Fog not installing on AWS OpsWorks Chef 11

Our OpsWork Chef scripts to spin-up an EC2 instance have stopped working.

My interpretation of the log file, extract below, is that Route53 is trying to use Fog, but Fog can not be installed as Nokogiri requires Ruby 2.1.0 or above.

After some Googleing I find that the version of Ruby is tied the the OpsWork version and as we are using Chef 11 is Ruby 2.0.

What I do not understand is that we have a pinned version on Nokogirl

gem_package "nokogiri" do
  action :install
  version "1.5.11"
end

All the Chef scripts where running last year, so I'm guessing something changed in Nokogiri or Fog. Any help would be appreciated.

From log...
[2017-01-30T09:29:48+10:00] INFO: Processing package[autoconf] action nothing (build-essential::_debian line 108)
[2017-01-30T09:29:48+10:00] INFO: Processing package[binutils-doc] action nothing (build-essential::_debian line 108)
[2017-01-30T09:29:48+10:00] INFO: Processing package[bison] action nothing (build-essential::_debian line 108)
[2017-01-30T09:29:48+10:00] INFO: Processing package[build-essential] action nothing (build-essential::_debian line 108)
[2017-01-30T09:29:48+10:00] INFO: Processing package[flex] action nothing (build-essential::_debian line 108)
[2017-01-30T09:29:48+10:00] INFO: Processing package[gettext] action nothing (build-essential::_debian line 108)
[2017-01-30T09:29:48+10:00] INFO: Processing package[ncurses-dev] action nothing (build-essential::_debian line 108)
[2017-01-30T09:29:48+10:00] INFO: Processing package[libxml2-dev] action nothing (route53::default line 23)
[2017-01-30T09:29:48+10:00] INFO: Processing package[libxslt1-dev] action nothing (route53::default line 28)
[2017-01-30T09:29:48+10:00] INFO: Processing chef_gem[fog] action install (route53::default line 44)
[2017-01-30T09:29:48+10:00] INFO: Installing chef-gem fog = 1.20
ERROR:  Error installing fog:
nokogiri requires Ruby version >= 2.1.0.
[2017-01-30T09:29:55+10:00] INFO: 
[2017-01-30T09:29:55+10:00] INFO: Processing route53_record[fresno.servers.digitaldealer.com.au] action create (digitaldealer::adddns line 4)

================================================================================
Error executing action `create` on resource 'route53_record[fresno.servers.digitaldealer.com.au]'
================================================================================


LoadError
---------
cannot load such file -- fog/aws/dns


Cookbook Trace:
---------------
/var/lib/aws/opsworks/cache.stage2/cookbooks/route53/providers/record.rb:3:in `require'
/var/lib/aws/opsworks/cache.stage2/cookbooks/route53/providers/record.rb:3:in `block in class_from_file'

When installing gem available during chef run you should use chef_gem resource (as it's used by route53::default ).

chef_gem "nokogiri" do
  action :install
  version "1.5.11"
end

Make sure it's executed before route53::default .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM