Chef gem installer fails on ubuntu 14.04

Bug #1553345 reported by ryan vanniekerk on 2016-03-04
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cloud-init (Ubuntu)

Bug Description

Running the "gem" version of the chef install fails on the latest Ubuntu server 14.04 LTS AMI (ami-fce3c696).

Here is part of my user-data for cloud init:

  - apt-get update && apt-get upgrade cloud-init
  - apt-get install build-essential
  - apt-get install -q -y <%= find_in_map("SoftwarePropertiesPackage", ref("LCOSVersion"), "PackageName") %>
  - apt-add-repository -y ppa:brightbox/ruby-ng
  - echo "Updating package lists..."
  - apt-get update -qq
  - echo "Installing ruby..."
  - apt-get install -q -y ruby<%= find_in_map("RubyVersionToPackageInfo", ref("AppRubyVersion"), "Version") %>
  - apt-get install -q -y ruby<%= find_in_map("RubyVersionToPackageInfo", ref("AppRubyVersion"), "Version") %>-dev
  - update-alternatives --set ruby /usr/bin/ruby<%= find_in_map("RubyVersionToPackageInfo", ref("AppRubyVersion"), "Version") %>
  - update-alternatives --set gem /usr/bin/gem<%= find_in_map("RubyVersionToPackageInfo", ref("AppRubyVersion"), "Version") %>
  - echo "Updating rubygems to latest version..."
  - gem update --system --no-rdoc --no-ri
  install_type: gems
  version: <%= ref("ChefVersion") %>

Here is the output from cloud-init

Mar 4 18:00:04 ip-xxxxxxx[CLOUDINIT][DEBUG]: Running chef (<module 'cloudinit.config.cc_chef' from '/usr/lib/python2.7/dist-packages/cloudinit/config/cc_chef.pyc'>) failed#012Traceback (most recent call last):#012 File "/usr/lib/python2.7/dist-packages/cloudinit/", line 658, in _run_modules#012, mod.handle, func_args, freq=freq)#012 File "/usr/lib/python2.7/dist-packages/cloudinit/", line 63, in run#012 return, functor, args, freq, clear_on_fail)#012 File "/usr/lib/python2.7/dist-packages/cloudinit/", line 197, in run#012 results = functor(*args)#012 File "/usr/lib/python2.7/dist-packages/cloudinit/config/", line 99, in handle#012 install_chef_from_gems(cloud.distro, ruby_version, chef_version)#012 File "/usr/lib/python2.7/dist-packages/cloudinit/config/", line 128, in install_chef_from_gems#012 distro.install_packages(get_ruby_packages(ruby_version))#012AttributeError: 'str' object has no attribute 'install_packages'

Related branches

tags: added: chef
Scott Moser (smoser) on 2016-04-04
Changed in cloud-init:
importance: Undecided → Medium
status: New → Confirmed
Scott Moser (smoser) wrote :

fixed in trunk at 1197

Changed in cloud-init (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Changed in cloud-init:
status: Confirmed → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cloud-init - 0.7.7~bzr1200-0ubuntu1

cloud-init (0.7.7~bzr1200-0ubuntu1) xenial; urgency=medium

  * New upstream snapshot.
    - fix adding of users when no group is specified (LP: #1562918)
    - fix write_files with compressed content (LP: #1565638)
    - systemd: do not specify After of obsolete (LP: #1536964)
    - chef: fix chef installation from gems (LP: #1553345)
    - disk_setup: correctly send force to mkfs on block devices (LP: #1548772)
    - locale: list unsupported environment settings in warning (LP: #1558069)
    - fix NoCloud and other datasources if no datasource config (LP: #1514407)

 -- Scott Moser <email address hidden> Wed, 06 Apr 2016 13:07:27 -0400

Changed in cloud-init (Ubuntu):
status: Confirmed → Fix Released
Scott Moser (smoser) wrote :

This is fixed in cloud-init 0.7.7

Changed in cloud-init:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers