Specify chef bootstrap Ubuntu gems version

308 views
Skip to first unread message

Thomas

unread,
Dec 11, 2012, 4:47:22 AM12/11/12
to jcl...@googlegroups.com
Hi,
How can one specify which Ubuntu version of the bootstrap Ubuntu gems file to use? I'm trying to setup a node
using chef for an Ubuntu 12.04 machine but the gems file use is always ubuntu10.04-gems.erb (there exists one ubuntu12.04-gems.erb)
which fails the install. Can I specify chef to use the 12.04 version via jclouds-chef?

KR
Thomas

Ignasi

unread,
Dec 11, 2012, 8:25:39 AM12/11/12
to jcl...@googlegroups.com
Hi Thomas,

There are several ways of using Chef with jclouds:

1. You can manually install all Chef gems and manually configure the chef-client (not the recommended one :)).
2. If you have a Chef Server (or a Hosted or Private Chef) you can use the jclouds-chef project.
3. If you don't have a Chef Server, you can use Chef Solo to bootstrap and configure your node. This is only available in jclouds 1.6.0-SNAPSHOT.

If you are using approach (1), I'd recommend to use the InstallChefGems statement [1], since it will take care of installing the required gems. However, this is only available since jclouds-1.6.0-SNAPSHOT, so I don't know if you would be able to use it.
If you are using approach (2), you should use the jclouds-chef project to bootstrap your node. It will take care of installing all required Chef gems, registering the node in the Chef server and execute its run list. You can find examples here: [2].
If you prefer to use Chef Solo, you can take a look at this blog post [3] that shows a couple of examples of how to use that statement (this is only available in jclouds-1.6.0-SNAPSHOT).

You can also take a look at the chef-basics example [4] to see jclouds-chef and Chef Solo in action.

If you use the approaches above you should not have issues regarding the version of Chef gems.

Let us know if this works for you!


Ignasi






Thomas

--
You received this message because you are subscribed to the Google Groups "jclouds" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jclouds/-/djX2wXgPgUgJ.
To post to this group, send email to jcl...@googlegroups.com.
To unsubscribe from this group, send email to jclouds+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jclouds?hl=en.

Thomas

unread,
Dec 12, 2012, 9:46:27 AM12/12/12
to jcl...@googlegroups.com
Hi Ignasi,

Thank you for the answer!

I went for approach (2), It still seems to try and use Ubuntu 10.04 install gems. What I really would like to do is something similar to Knife Bootstrap [1] --distro flag and specify Ubuntu 12.04.

KR
Thomas

[1] http://wiki.opscode.com/display/chef/Knife+Bootstrap

Ignasi

unread,
Dec 12, 2012, 9:58:43 AM12/12/12
to jcl...@googlegroups.com

Thomas

unread,
Dec 12, 2012, 10:19:44 AM12/12/12
to jcl...@googlegroups.com
I see, I'm using 1.5.3.

Ignasi

unread,
Dec 12, 2012, 10:44:55 AM12/12/12
to jcl...@googlegroups.com
Could you please share the error you are getting, to see how we can improve the script to take care of installing the gems properly?


To view this discussion on the web visit https://groups.google.com/d/msg/jclouds/-/kGif522TmRQJ.

Ignasi

unread,
Dec 12, 2012, 10:49:17 AM12/12/12
to jcl...@googlegroups.com
The libruby-extras and libruby1.8-extras packages have been removed from Ubuntu 12.04, but they are not required to be able to run Chef, so we have removed them in 1.6.0-SNAPSHOT.

If the bootstrap is failing because it can not find those packages, could you try with 1.6.0-SNAPSHOT, to see if it fixes your issue?

Thomas

unread,
Dec 12, 2012, 10:58:38 AM12/12/12
to jcl...@googlegroups.com
Yeah it fail because of libruby1.8-extras and libruby-extras.
(FYI:
16:46:36.687 [user thread 2] DEBUG net.schmizz.sshj.common.StreamCopier - 1.326171875 KiB transferred  in 0.013 seconds (102.01322115384616 KiB/s)
16:46:36.687 [user thread 2] DEBUG net.schmizz.sshj.common.StreamCopier - 0.0 KiB transferred  in 0.0 seconds (NaN KiB/s)
16:46:36.687 [user thread 2] DEBUG jclouds.ssh - << (ubuntu:rsa[fingerprint(7f:dd:ff:0e:5d:ae:7f:65:64:80:b3:ce:0d:cb:d0:f5),sha1(08:5e:8e:13:3c:6c:f2:c9:02:7b:4f:33:c5:76:cc:43:75:f1:97:90)]@ext.ip:22) acquired {output=E: Unable to locate package libruby-extras
E: Unable to locate package libruby1.8-extras
E: Couldn't find any package by regex 'libruby1.8-extras'
--2012-12-12 15:46:39--  http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
Resolving production.cf.rubygems.org (production.cf.rubygems.org)... 205.251.219.73, 205.251.219.108, 205.251.219.115, ...
Connecting to production.cf.rubygems.org (production.cf.rubygems.org)|205.251.219.73|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 290986 (284K) [application/octet-stream]
Saving to: `rubygems-1.3.7.tgz'

     0K .......... .......... .......... .......... .......... 17% 2.34M 0s
    50K .......... .......... .......... .......... .......... 35% 2.31M 0s
   100K .......... .......... .......... .......... .......... 52% 4.57M 0s
   150K .......... .......... .......... .......... .......... 70% 4.59M 0s
   200K .......... .......... .......... .......... .......... 87% 4.55M 0s
   250K .......... .......... .......... ....                 100% 3.26M=0.08s

2012-12-12 15:46:39 (3.29 MB/s) - `rubygems-1.3.7.tgz' saved [290986/290986]

/tmp/bootstrap/bootstrap.sh: line 25: ruby: command not found
/tmp/bootstrap/bootstrap.sh: line 28: /usr/bin/gem: No such file or directory
/tmp/bootstrap/bootstrap.sh: line 74: chef-client: command not found
, error=, exitStatus=0}
)

Will try upgrading to 1.6.0-SNAPSHOT and get back to you.

/T

Thomas

unread,
Dec 13, 2012, 7:47:54 AM12/13/12
to jcl...@googlegroups.com
Now I have migrated to 1.6.0-SNAPSHOT and tested my program, It was a success! Thanks for the suggestions!

KR
Thomas
Reply all
Reply to author
Forward
0 new messages