Chef example cloud-init script wrong repo for oneiric

Bug #960564 reported by Lorin Hochstein
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Low
Lorin Hochstein

Bug Description

The chef cloud-init example (doc/examples/cloud-config-chef.txt) contains:

apt_mirror: http://apt.opscode.com/

Unfortunately, this won't install the correct repository for Chef 0.10.x. According to http://wiki.opscode.com/display/chef/Opscode+Apt+Repository+Excerpt, it expects something like:

deb http://apt.opscode.com/ oneiric-0.10 main

But cloud-init sets up

deb http://apt.opscode.com/ oneiric main

For oneiric, only the former syntax works, and so cloud-init fails with an error like:

Mar 20 19:39:39 domU-12-31-39-0A-9D-CB [CLOUDINIT] __init__.py[WARNING]: Traceback (most recent call last):#012 File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/__init__.py", line 108, in run_cc_modules#012 cc.handle(name, run_args, freq=freq)#012 File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/__init__.py", line 72, in handle#012 [ name, self.cfg, self.cloud, cloudinit.log, args ])#012 File "/usr/lib/python2.7/dist-packages/cloudinit/__init__.py", line 309, in sem_and_run#012 func(*args)#012 File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/cc_chef.py", line 76, in handle#012 install_chef_from_gems(ruby_version, chef_version)#012 File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/cc_chef.py", line 85, in install_chef_from_gems#012 cc.install_packages(ruby_packages[ruby_version])#012 File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/__init__.py", line 249, in install_packages#012 update_package_sources()#012 File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/__init__.py", line 246, in update_package_sources#012 run_per_instance("update-sources", apt_get, ("update",))#012 File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/__init__.py", line 230, in run_per_instance#012 func(*args)#012 File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/__init__.py", line 243, in apt_get#012 subprocess.check_call(cmd,env=e)#012 File "/usr/lib/python2.7/subprocess.py", line 511, in check_call#012 raise CalledProcessError(retcode, cmd)#012CalledProcessError: Command '['apt-get', '--option', 'Dpkg::Options::=--force-confold', '--assume-yes', 'update']' returned non-zero exit status 100

Which is because it's trying to pull from nonexistent repos, such as:

W: Failed to fetch http://apt.opscode.com/dists/oneiric/main/source/Sources 404 Not Found

Related branches

Revision history for this message
Scott Moser (smoser) wrote :

Hi,
  Using 'apt_mirror' is probably not really right (sorry for the bad documentation).
  Its probably better to use:

apt_sources:
  - source: "deb http://apt.opscode.com/ oneiric-0.10 main"

Can you replace the 'apt_mirror' in the example cloud-config and report back as to if that works?

I'd like to have a functional 12.04 chef, so our time is short.

Also, does this work on 12.04 ?

I'd really appreciate testing and feedback you can provide. I'm not a chef user.

Sorry for the slow reply. Please feel free to ping me (smoser) in Freenode IRC

Revision history for this message
Lorin Hochstein (lorinh) wrote :

Linked an example that works with 12.04, although it doesn't work with packages (will submit a separate bug report for this).

Revision history for this message
Scott Moser (smoser) wrote :

fixed in cloud-init trunk at revno 555.

Changed in cloud-init:
assignee: nobody → Lorin Hochstein (lorinh)
importance: Undecided → Low
status: New → In Progress
status: In Progress → Fix Committed
Scott Moser (smoser)
Changed in cloud-init:
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.