From d0e6aa6f74c74617317d4b515496d92d80bc8323 Mon Sep 17 00:00:00 2001 From: Ben West Date: Tue, 17 Jun 2014 09:31:24 -0500 Subject: [PATCH 1/3] Fetch apt repo key directly from opscode instead of keys.gnupg.net, install opscode keyring --- lib/chef/knife/bootstrap/ubuntu12.04-ironfan.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/chef/knife/bootstrap/ubuntu12.04-ironfan.erb b/lib/chef/knife/bootstrap/ubuntu12.04-ironfan.erb index 2aa55f18..7f753f04 100644 --- a/lib/chef/knife/bootstrap/ubuntu12.04-ironfan.erb +++ b/lib/chef/knife/bootstrap/ubuntu12.04-ironfan.erb @@ -18,13 +18,14 @@ echo "deb http://apt.opscode.com/ `lsb_release -cs`-0.10 main" | sudo tee /etc/a # Make sure that opscode chef is on the apt repo list. sudo mkdir -p /etc/apt/trusted.gpg.d -gpg --keyserver keys.gnupg.net --recv-keys 83EF826A +gpg --fetch-key http://apt.opscode.com/packages@opscode.com.gpg.key gpg --export packages@opscode.com | sudo tee /etc/apt/trusted.gpg.d/opscode-keyring.gpg > /dev/null date > /etc/box_build_time echo -e "`date` \n\n**** \n**** apt update:\n****\n" apt-get --force-yes -y update +apt-get -y -o Dpkg::Options::="--force-confnew" install opscode-keyring apt-get --force-yes -y dist-upgrade echo -e "`date` \n\n**** \n**** Installing base packages:\n****\n" From 9918c1625ec2aebe328563fa41d71eca46b47754 Mon Sep 17 00:00:00 2001 From: Ben West Date: Tue, 17 Jun 2014 09:35:01 -0500 Subject: [PATCH 2/3] ssh_user is parametrized --- lib/chef/knife/bootstrap/ubuntu12.04-ironfan.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chef/knife/bootstrap/ubuntu12.04-ironfan.erb b/lib/chef/knife/bootstrap/ubuntu12.04-ironfan.erb index 7f753f04..7d4b6cd2 100644 --- a/lib/chef/knife/bootstrap/ubuntu12.04-ironfan.erb +++ b/lib/chef/knife/bootstrap/ubuntu12.04-ironfan.erb @@ -46,7 +46,7 @@ export DEBIAN_FRONTEND=noninteractive # Install a self-contained Chef client because Ubuntu ships with Ruby 1.8.x, # which is not compatible with Ironfan -echo 'gem: --no-ri --no-rdoc' > /home/ubuntu/.gemrc +echo 'gem: --no-ri --no-rdoc' > /home/<%= @config[:ssh_user] %>/.gemrc echo 'gem: --no-ri --no-rdoc' > /root/.gemrc if [ ! -f /opt/chef/bin/chef-client ]; then curl -L http://www.opscode.com/chef/install.sh | sudo bash From 206aa6ce791f40c6c7de935f174bfed46ece25ac Mon Sep 17 00:00:00 2001 From: Ben West Date: Tue, 17 Jun 2014 09:37:53 -0500 Subject: [PATCH 3/3] better way to get opscode binaries into path, overwrite existing links so bootstrap doesn't fail --- lib/chef/knife/bootstrap/ubuntu12.04-ironfan.erb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/chef/knife/bootstrap/ubuntu12.04-ironfan.erb b/lib/chef/knife/bootstrap/ubuntu12.04-ironfan.erb index 7d4b6cd2..69199fe3 100644 --- a/lib/chef/knife/bootstrap/ubuntu12.04-ironfan.erb +++ b/lib/chef/knife/bootstrap/ubuntu12.04-ironfan.erb @@ -52,12 +52,15 @@ if [ ! -f /opt/chef/bin/chef-client ]; then curl -L http://www.opscode.com/chef/install.sh | sudo bash fi -# Replace /usr/local/sbin with the omnibus' bin, to get it into the PATH -mv /usr/local/sbin{,~} -ln -s /opt/chef/embedded/bin /usr/local/sbin - -# Link ruby into /usr/bin/ruby, to allow /usr/bin/env -ln -s /opt/chef/embedded/bin/ruby /usr/bin +# Link the binaries under /opt/chef/embedded/bin to /usr/local/sbin, overwriting existing links +mkdir -p /usr/local/sbin +for f in /opt/chef/embedded/bin/* +do + ln -f -s $f /usr/local/sbin +done + +# Link ruby into /usr/bin/ruby, to allow /usr/bin/env, overwriting destination +ln -f -s /opt/chef/embedded/bin/ruby /usr/bin gem install extlib bundler json right_aws pry fog