diff options
author | danielsdeleo <dan@opscode.com> | 2013-01-17 13:43:28 -0800 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2013-01-17 15:02:54 -0800 |
commit | 62f9b0e3be8e22eef092163c331b7d3f8d350f94 (patch) | |
tree | 6b37c7a275918580b59c16de32a16c24f5dbe77f /lib/chef/knife/bootstrap/centos5-gems.erb | |
parent | 30ec971df95264b39e5e403c08b634d4708f5bee (diff) | |
parent | b568c4d060765e75023f50f24d0a394ada5aed0b (diff) | |
download | chef-62f9b0e3be8e22eef092163c331b7d3f8d350f94.tar.gz |
Merge branch '10-stable' into integrate-chef-10-18-0
Conflicts:
.gitattributes
chef-expander/Rakefile
chef-expander/lib/chef/expander/version.rb
chef-server-api/Rakefile
chef-server-api/chef-server-api.gemspec
chef-server-api/lib/chef-server-api/version.rb
chef-server-webui/Rakefile
chef-server-webui/chef-server-webui.gemspec
chef-server-webui/lib/chef-server-webui/version.rb
chef-server/Rakefile
chef-server/lib/chef-server/version.rb
chef-solr/lib/chef/solr/version.rb
chef.gemspec
chef/Rakefile
chef/spec/support/platform_helpers.rb
chef/spec/support/shared/functional/file_resource.rb
chef/spec/unit/api_client_spec.rb
chef/spec/unit/provider/directory_spec.rb
ci/jenkins_run_tests.bat
ci/jenkins_run_tests.sh
distro/common/html/chef-client.8.html
distro/common/html/chef-expander.8.html
distro/common/html/chef-expanderctl.8.html
distro/common/html/chef-server-webui.8.html
distro/common/html/chef-server.8.html
distro/common/html/chef-shell.1.html
distro/common/html/chef-solo.8.html
distro/common/html/chef-solr.8.html
distro/common/html/knife-bootstrap.1.html
distro/common/html/knife-client.1.html
distro/common/html/knife-configure.1.html
distro/common/html/knife-cookbook-site.1.html
distro/common/html/knife-cookbook.1.html
distro/common/html/knife-data-bag.1.html
distro/common/html/knife-environment.1.html
distro/common/html/knife-exec.1.html
distro/common/html/knife-index.1.html
distro/common/html/knife-node.1.html
distro/common/html/knife-role.1.html
distro/common/html/knife-search.1.html
distro/common/html/knife-ssh.1.html
distro/common/html/knife-status.1.html
distro/common/html/knife-tag.1.html
distro/common/html/knife.1.html
distro/common/man/man1/chef-shell.1
distro/common/man/man1/knife-bootstrap.1
distro/common/man/man1/knife-client.1
distro/common/man/man1/knife-configure.1
distro/common/man/man1/knife-cookbook-site.1
distro/common/man/man1/knife-cookbook.1
distro/common/man/man1/knife-data-bag.1
distro/common/man/man1/knife-environment.1
distro/common/man/man1/knife-exec.1
distro/common/man/man1/knife-index.1
distro/common/man/man1/knife-node.1
distro/common/man/man1/knife-role.1
distro/common/man/man1/knife-search.1
distro/common/man/man1/knife-ssh.1
distro/common/man/man1/knife-status.1
distro/common/man/man1/knife-tag.1
distro/common/man/man1/knife.1
distro/common/man/man8/chef-client.8
distro/common/man/man8/chef-expander.8
distro/common/man/man8/chef-expanderctl.8
distro/common/man/man8/chef-server-webui.8
distro/common/man/man8/chef-server.8
distro/common/man/man8/chef-solo.8
distro/common/man/man8/chef-solr.8
lib/chef/api_client.rb
lib/chef/rest.rb
lib/chef/version.rb
spec/functional/knife/ssh_spec.rb
spec/functional/resource/cookbook_file_spec.rb
spec/spec_helper.rb
spec/stress/win32/security_spec.rb
spec/support/shared/functional/securable_resource.rb
spec/unit/config_spec.rb
spec/unit/knife/ssh_spec.rb
Diffstat (limited to 'lib/chef/knife/bootstrap/centos5-gems.erb')
-rw-r--r-- | lib/chef/knife/bootstrap/centos5-gems.erb | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/lib/chef/knife/bootstrap/centos5-gems.erb b/lib/chef/knife/bootstrap/centos5-gems.erb index f9626c3c2b..5db3c1a0e8 100644 --- a/lib/chef/knife/bootstrap/centos5-gems.erb +++ b/lib/chef/knife/bootstrap/centos5-gems.erb @@ -2,6 +2,11 @@ bash -c ' <%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%> if [ ! -f /usr/bin/chef-client ]; then + tmp_dir=$(mktemp -d) || exit 1 + pushd "$tmp_dir" + + yum install -y wget + wget <%= "--proxy=on " if knife_config[:bootstrap_proxy] %>http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm rpm -Uvh epel-release-5-4.noarch.rpm wget <%= "--proxy=on " if knife_config[:bootstrap_proxy] %>http://rpm.aegisco.com/aegisco/rhel/aegisco-rhel.rpm @@ -9,11 +14,11 @@ if [ ! -f /usr/bin/chef-client ]; then yum install -y ruby ruby-devel gcc gcc-c++ automake autoconf make - cd /tmp - wget <%= "--proxy=on " if knife_config[:bootstrap_proxy] %>http://production.cf.rubygems.org/rubygems/rubygems-1.6.2.tgz - tar zxf rubygems-1.6.2.tgz - cd rubygems-1.6.2 - ruby setup.rb --no-format-executable + wget <%= "--proxy=on " if knife_config[:bootstrap_proxy] %>http://production.cf.rubygems.org/rubygems/rubygems-1.6.2.tgz -O - | tar zxf - + (cd rubygems-1.6.2 && ruby setup.rb --no-format-executable) + + popd + rm -r "$tmp_dir" fi gem update --system @@ -23,23 +28,15 @@ gem install chef --no-rdoc --no-ri --verbose <%= bootstrap_version_string %> mkdir -p /etc/chef -( -cat <<'EOP' +awk NF > /etc/chef/validation.pem <<'EOP' <%= validation_key %> EOP -) > /tmp/validation.pem -awk NF /tmp/validation.pem > /etc/chef/validation.pem -rm /tmp/validation.pem chmod 0600 /etc/chef/validation.pem <% if @chef_config[:encrypted_data_bag_secret] -%> -( -cat <<'EOP' +awk NF > /etc/chef/encrypted_data_bag_secret <<'EOP' <%= encrypted_data_bag_secret %> EOP -) > /tmp/encrypted_data_bag_secret -awk NF /tmp/encrypted_data_bag_secret > /etc/chef/encrypted_data_bag_secret -rm /tmp/encrypted_data_bag_secret chmod 0600 /etc/chef/encrypted_data_bag_secret <% end -%> @@ -48,24 +45,18 @@ chmod 0600 /etc/chef/encrypted_data_bag_secret mkdir -p /etc/chef/ohai/hints <% @chef_config[:knife][:hints].each do |name, hash| -%> -( -cat <<'EOP' +cat > /etc/chef/ohai/hints/<%= name %>.json <<'EOP' <%= hash.to_json %> EOP -) > /etc/chef/ohai/hints/<%= name %>.json <% end -%> <% end -%> -( -cat <<'EOP' +cat > /etc/chef/client.rb <<'EOP' <%= config_content %> EOP -) > /etc/chef/client.rb -( -cat <<'EOP' +cat > /etc/chef/first-boot.json <<'EOP' <%= first_boot.to_json %> EOP -) > /etc/chef/first-boot.json <%= start_chef %>' |