[chef] Local install using chef_gem


Chronological Thread 
  • From: JOHN HASTY < >
  • To:
  • Subject: [chef] Local install using chef_gem
  • Date: Thu, 30 Jan 2014 17:19:42 -0600

I am building servers that are behind firewalls where we don't want to fetch things from the Internet. I would like to be able to obtain the gems necessary for the process and copy them from our internal repository and then install locally.

I tried the following:

  #chef_gem "zk" do
    #action :install
  #end
 
  if ! File.exist?("/opt/chef/maint/gemsetup")
 
    directory "/tmp/gems" do
      owner "root"
      action :create
    end
   
    %w(little-plugger-1.1.3.gem logger-1.2.8.gem mini_portile-0.5.2.gem logging-1.7.2.gem zookeeper-1.4.8.gem zk-1.9.3.gem).each do |gemfile|
   
      bash "Fetch #{gemfile} and install" do
        user "root"
        cwd  "/tmp/gems"
        code <<-EOH
        wget http://gitserver:4002/gems/#{gemfile}
        /opt/chef/embedded/bin/gem install -V #{gemfile}
        EOH
      end

But when I got to the line of code "require 'zk', it blew up.



JOHN HASTY
Software as a Service - DevOps
Software Group


Phone: 1-512-804-9968
E-mail:
  " target="_blank">
IBM

2407 S Congress Ave Ste E-350
Austin, TX 78704
United States




Archive powered by MHonArc 2.6.16.

§