When bootstrapping a server, how do you guys get gems setup in your path?


#1

I’m using ec2 and chef-solo, and when I fireup an instance I boostrap it by
updating apt and upgrading etc., and then install some basic things like:

sudo apt-get install -y wget build-essential ruby1.8 ruby1.8-dev irb1.8
rdoc1.8 zlib1g-dev libopenssl-ruby1.8 rubygems1.8 libopenssl-ruby
libzlib-ruby libssl-dev libpcre3-dev libcurl4-openssl-dev

  1. rubygems, rake and bundler.
  2. sudo gem install -y ohai chef --no-ri --no-rdoc

After this, I upload my chef cookbook, and then when I try and run:

sudo chef-solo -j chef.json -c /home/ubuntu/chef/config/solo.rb

I get an error b/c chef-solo isn’t in my path, what do you guys do to get
it in your path?

I’m sure my bootstrap method isn’t ideal so I’m welcome to suggestions.


#2

Hi,

It would be fine to continue doing these steps in the bootstrap, but if you were to instead use the Omnibus installer to install Chef, your path issues should go away.

Check out this wiki page on using the Omnibus installer: http://wiki.opscode.com/display/chef/Installing+Omnibus+Chef+Client+on+Linux+and+Mac

Graham


Graham Christensen

On Monday, February 18, 2013 at 3:29 PM, S Ahmed wrote:

I’m using ec2 and chef-solo, and when I fireup an instance I boostrap it by updating apt and upgrading etc., and then install some basic things like:

sudo apt-get install -y wget build-essential ruby1.8 ruby1.8-dev irb1.8 rdoc1.8 zlib1g-dev libopenssl-ruby1.8 rubygems1.8 libopenssl-ruby libzlib-ruby libssl-dev libpcre3-dev libcurl4-openssl-dev

  1. rubygems, rake and bundler.
  2. sudo gem install -y ohai chef --no-ri --no-rdoc

After this, I upload my chef cookbook, and then when I try and run:

sudo chef-solo -j chef.json -c /home/ubuntu/chef/config/solo.rb

I get an error b/c chef-solo isn’t in my path, what do you guys do to get it in your path?

I’m sure my bootstrap method isn’t ideal so I’m welcome to suggestions.


#3

Thanks Graham.

So just to clear things up, how will my process change now if I was to use
Omnibus? I will have to use a different recipe to correctly upgrade ruby
and setup gems etc. for other things like rails right?

On Mon, Feb 18, 2013 at 3:32 PM, Graham Christensen graham@grahamc.comwrote:

Hi,

It would be fine to continue doing these steps in the bootstrap, but if
you were to instead use the Omnibus installer to install Chef, your path
issues should go away.

Check out this wiki page on using the Omnibus installer:
http://wiki.opscode.com/display/chef/Installing+Omnibus+Chef+Client+on+Linux+and+Mac

Graham


Graham Christensen

On Monday, February 18, 2013 at 3:29 PM, S Ahmed wrote:

I’m using ec2 and chef-solo, and when I fireup an instance I boostrap it
by updating apt and upgrading etc., and then install some basic things like:

sudo apt-get install -y wget build-essential ruby1.8 ruby1.8-dev irb1.8
rdoc1.8 zlib1g-dev libopenssl-ruby1.8 rubygems1.8 libopenssl-ruby
libzlib-ruby libssl-dev libpcre3-dev libcurl4-openssl-dev

  1. rubygems, rake and bundler.
  2. sudo gem install -y ohai chef --no-ri --no-rdoc

After this, I upload my chef cookbook, and then when I try and run:

sudo chef-solo -j chef.json -c /home/ubuntu/chef/config/solo.rb

I get an error b/c chef-solo isn’t in my path, what do you guys do to get
it in your path?

I’m sure my bootstrap method isn’t ideal so I’m welcome to suggestions.


#4

If you switch to Omnibus, you’ll get Chef deployed to /opt/chef with
the ‘omnibus stack’, including ruby and all of the dependencies for
Chef itself. It is standalone, and can be upgraded or removed easily.

If you want to deploy software to the same system that also uses ruby,
I’d suggested you deploy a system ruby from binary packages, rbenv,
RVM or build from source.

Cheers,

AJ

On 19 February 2013 09:47, S Ahmed sahmed1020@gmail.com wrote:

Thanks Graham.

So just to clear things up, how will my process change now if I was to use
Omnibus? I will have to use a different recipe to correctly upgrade ruby
and setup gems etc. for other things like rails right?

On Mon, Feb 18, 2013 at 3:32 PM, Graham Christensen graham@grahamc.com
wrote:

Hi,

It would be fine to continue doing these steps in the bootstrap, but if
you were to instead use the Omnibus installer to install Chef, your path
issues should go away.

Check out this wiki page on using the Omnibus installer:
http://wiki.opscode.com/display/chef/Installing+Omnibus+Chef+Client+on+Linux+and+Mac

Graham


Graham Christensen

On Monday, February 18, 2013 at 3:29 PM, S Ahmed wrote:

I’m using ec2 and chef-solo, and when I fireup an instance I boostrap it
by updating apt and upgrading etc., and then install some basic things like:

sudo apt-get install -y wget build-essential ruby1.8 ruby1.8-dev irb1.8
rdoc1.8 zlib1g-dev libopenssl-ruby1.8 rubygems1.8 libopenssl-ruby
libzlib-ruby libssl-dev libpcre3-dev libcurl4-openssl-dev

  1. rubygems, rake and bundler.
  2. sudo gem install -y ohai chef --no-ri --no-rdoc

After this, I upload my chef cookbook, and then when I try and run:

sudo chef-solo -j chef.json -c /home/ubuntu/chef/config/solo.rb

I get an error b/c chef-solo isn’t in my path, what do you guys do to get
it in your path?

I’m sure my bootstrap method isn’t ideal so I’m welcome to suggestions.


#5

Ok I installed omnibus (easy enough!) and it makes allot of sense now that
I understand what it does.

On Mon, Feb 18, 2013 at 3:52 PM, AJ Christensen aj@junglist.gen.nz wrote:

If you switch to Omnibus, you’ll get Chef deployed to /opt/chef with
the ‘omnibus stack’, including ruby and all of the dependencies for
Chef itself. It is standalone, and can be upgraded or removed easily.

If you want to deploy software to the same system that also uses ruby,
I’d suggested you deploy a system ruby from binary packages, rbenv,
RVM or build from source.

Cheers,

AJ

On 19 February 2013 09:47, S Ahmed sahmed1020@gmail.com wrote:

Thanks Graham.

So just to clear things up, how will my process change now if I was to
use
Omnibus? I will have to use a different recipe to correctly upgrade ruby
and setup gems etc. for other things like rails right?

On Mon, Feb 18, 2013 at 3:32 PM, Graham Christensen graham@grahamc.com
wrote:

Hi,

It would be fine to continue doing these steps in the bootstrap, but if
you were to instead use the Omnibus installer to install Chef, your path
issues should go away.

Check out this wiki page on using the Omnibus installer:

http://wiki.opscode.com/display/chef/Installing+Omnibus+Chef+Client+on+Linux+and+Mac

Graham


Graham Christensen

On Monday, February 18, 2013 at 3:29 PM, S Ahmed wrote:

I’m using ec2 and chef-solo, and when I fireup an instance I boostrap it
by updating apt and upgrading etc., and then install some basic things
like:

sudo apt-get install -y wget build-essential ruby1.8 ruby1.8-dev irb1.8
rdoc1.8 zlib1g-dev libopenssl-ruby1.8 rubygems1.8 libopenssl-ruby
libzlib-ruby libssl-dev libpcre3-dev libcurl4-openssl-dev

  1. rubygems, rake and bundler.
  2. sudo gem install -y ohai chef --no-ri --no-rdoc

After this, I upload my chef cookbook, and then when I try and run:

sudo chef-solo -j chef.json -c /home/ubuntu/chef/config/solo.rb

I get an error b/c chef-solo isn’t in my path, what do you guys do to
get

it in your path?

I’m sure my bootstrap method isn’t ideal so I’m welcome to suggestions.