I’m trying to write this ppa to install ruby 1.9.3.p-294 from the brightbox ppa at:
ppa:brightbox/ruby-ng
with both way, LWRP and template/execute resource one, neither works.
When I run from the terminal on my ec2 server, it gets installed graciously.
But why the chef-recipe way blows up every time.
LWRP way
include_recipe "apt"
apt_repository “brightbox-ruby-ng” do
uri 'ppa:brightbox/ruby-ng’
distribution node[‘lsb’][‘codename’]
components [“main”]
keyserver "keyserver.ubuntu.com"
key "C300EE8C"
end
package “ruby” do
action :install
end
Template/Execute resource way
template “/etc/apt/sources.list.d/brightbox-ruby-ng-source.list” do
source "brightbox-ruby-ng-source.list.erb"
notifies :run, resources(:execute => “apt-get update”), :immediately
end
I'm trying to write this ppa to install ruby 1.9.3.p-294 from the
brightbox ppa at:
ppa:brightbox/ruby-ng
with both way, LWRP and template/execute resource one, neither works.
When I run from the terminal on my ec2 server, it gets installed
graciously.
But why the chef-recipe way blows up every time.
LWRP way
include_recipe "apt"
apt_repository "brightbox-ruby-ng" do
uri 'ppa:brightbox/ruby-ng'
distribution node['lsb']['codename']
components ["main"]
keyserver "keyserver.ubuntu.com"
key "C300EE8C"
end
package "ruby" do
action :install
end
Template/Execute resource way
template "/etc/apt/sources.list.d/brightbox-ruby-ng-source.list" do
source "brightbox-ruby-ng-source.list.erb"
notifies :run, resources(:execute => "apt-get update"), :immediately
end
I'm trying to write this ppa to install ruby 1.9.3.p-294 from the brightbox ppa at:
ppa:brightbox/ruby-ng
with both way, LWRP and template/execute resource one, neither works.
When I run from the terminal on my ec2 server, it gets installed graciously.
But why the chef-recipe way blows up every time.
LWRP way
include_recipe "apt"
apt_repository "brightbox-ruby-ng" do
uri 'ppa:brightbox/ruby-ng'
distribution node['lsb']['codename']
components ["main"]
keyserver "keyserver.ubuntu.com (http://keyserver.ubuntu.com)"
key "C300EE8C"
end
package "ruby" do
action :install
end
Template/Execute resource way
template "/etc/apt/sources.list.d/brightbox-ruby-ng-source.list" do
source "brightbox-ruby-ng-source.list.erb"
notifies :run, resources(:execute => "apt-get update"), :immediately
end
On Tue, Aug 21, 2012 at 11:14 AM, Sachin Sagar Rai millisami@gmail.com wrote:
FATAL: Chef::Exceptions::Exec: package[ruby] (base::install_ruby line 22)
had an error: Chef::Exceptions::Exec: apt-get -q -y install ruby=4.8-0bbox1
returned 100, expected 0
It looks like apt is failing for some reason.
What happens if you run "apt-get -q -y install ruby=4.8-0bbox1"?
I've encountered this problem as well and I'm nearly certain that a
background process is running apt-get update by default when you start up
the Ubuntu image. My solution was to tell cloud-init not to run apt-get
update by default. These 100 errors no longer come up.
Bryan I bet that command you asked him to run will run because it's a race
condition. By the time you log in to the Ubuntu box and run it, the
background cloud-init is done and other systems can run apt just fine.
-Kevin
On Tuesday, August 21, 2012, Bryan McLellan wrote:
On Tue, Aug 21, 2012 at 11:14 AM, Sachin Sagar Rai <millisami@gmail.com<javascript:;>>
wrote:
FATAL: Chef::Exceptions::Exec: package[ruby] (base::install_ruby line 22)
had an error: Chef::Exceptions::Exec: apt-get -q -y install
ruby=4.8-0bbox1
returned 100, expected 0
It looks like apt is failing for some reason.
What happens if you run "apt-get -q -y install ruby=4.8-0bbox1"?
I've encountered this problem as well and I'm nearly certain that a background process is running apt-get update by default when you start up the Ubuntu image. My solution was to tell cloud-init not to run apt-get update by default. These 100 errors no longer come up.
Bryan I bet that command you asked him to run will run because it's a race condition. By the time you log in to the Ubuntu box and run it, the background cloud-init is done and other systems can run apt just fine.
-Kevin
On Tuesday, August 21, 2012, Bryan McLellan wrote:
On Tue, Aug 21, 2012 at 11:14 AM, Sachin Sagar Rai millisami@gmail.com wrote:
FATAL: Chef::Exceptions::Exec: package[ruby] (base::install_ruby line 22)
had an error: Chef::Exceptions::Exec: apt-get -q -y install ruby=4.8-0bbox1
returned 100, expected 0
It looks like apt is failing for some reason.
What happens if you run "apt-get -q -y install ruby=4.8-0bbox1"?
On EC2 or Eucalyptus you have the ability to upload what they call
"user-data" that the ubuntu images know how to pull down and use as a bit
of configuration information. When using the knife-ec2 plugin I pass in an
executable bash script with the --user-data parameter.
If you're not using one of those clouds, something similar may be available
for what you're using. You can also just go into your base system image and
turn off cloud-init completely. It defaults to being on, and defaults to
running apt-get update which in some cases will conflict with the initial
chef bootstrap.
I've encountered this problem as well and I'm nearly certain that a
background process is running apt-get update by default when you start up
the Ubuntu image. My solution was to tell cloud-init not to run apt-get
update by default. These 100 errors no longer come up.
Bryan I bet that command you asked him to run will run because it's a race
condition. By the time you log in to the Ubuntu box and run it, the
background cloud-init is done and other systems can run apt just fine.
-Kevin
On Tuesday, August 21, 2012, Bryan McLellan wrote:
On Tue, Aug 21, 2012 at 11:14 AM, Sachin Sagar Rai millisami@gmail.com
wrote:
FATAL: Chef::Exceptions::Exec: package[ruby] (base::install_ruby line
had an error: Chef::Exceptions::Exec: apt-get -q -y install
ruby=4.8-0bbox1
returned 100, expected 0
It looks like apt is failing for some reason.
What happens if you run "apt-get -q -y install ruby=4.8-0bbox1"?
I do have to note though that this piece of code works for me with an older
version of the apt cookbook. I haven't really tested with the latest
version including that apt update timestamp functionality.