summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSerdar Sutay <serdar@opscode.com>2014-08-21 10:47:29 -0700
committerSerdar Sutay <serdar@opscode.com>2014-08-26 15:42:26 -0700
commitdbb378c78b94745999e8c7058cec37faec51d3dd (patch)
tree8c0a5dafb9f5a06195e73443a58c60b566e24a9f /lib
parentf5ff27125f1da00fede09ff66b298f583cce5257 (diff)
downloadchef-dbb378c78b94745999e8c7058cec37faec51d3dd.tar.gz
Remove the bootstrap templates that does chef install via gems.
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/knife/bootstrap.rb4
-rw-r--r--lib/chef/knife/bootstrap/archlinux-gems.erb62
-rw-r--r--lib/chef/knife/bootstrap/centos5-gems.erb62
-rw-r--r--lib/chef/knife/bootstrap/chef-full.erb1
-rw-r--r--lib/chef/knife/bootstrap/fedora13-gems.erb44
-rw-r--r--lib/chef/knife/bootstrap/ubuntu10.04-apt.erb53
-rw-r--r--lib/chef/knife/bootstrap/ubuntu10.04-gems.erb48
-rw-r--r--lib/chef/knife/bootstrap/ubuntu12.04-gems.erb46
-rw-r--r--lib/chef/knife/core/bootstrap_context.rb18
9 files changed, 1 insertions, 337 deletions
diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb
index d3d45bad4b..a055a75981 100644
--- a/lib/chef/knife/bootstrap.rb
+++ b/lib/chef/knife/bootstrap.rb
@@ -75,10 +75,6 @@ class Chef
:long => "--node-name NAME",
:description => "The Chef node name for your new node"
- option :prerelease,
- :long => "--prerelease",
- :description => "Install the pre-release chef gems"
-
option :bootstrap_version,
:long => "--bootstrap-version VERSION",
:description => "The version of Chef to install",
diff --git a/lib/chef/knife/bootstrap/archlinux-gems.erb b/lib/chef/knife/bootstrap/archlinux-gems.erb
deleted file mode 100644
index ab2aa7a7f1..0000000000
--- a/lib/chef/knife/bootstrap/archlinux-gems.erb
+++ /dev/null
@@ -1,62 +0,0 @@
-bash -c '
-<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%>
-
-if [ ! -f /usr/bin/chef-client ]; then
- pacman -Syy
- pacman -S --noconfirm ruby ntp base-devel
- ntpdate -u pool.ntp.org
- gem install ohai --no-user-install --no-document --verbose
- gem install chef --no-user-install --no-document --verbose <%= bootstrap_version_string %>
-fi
-
-mkdir -p /etc/chef
-
-cat > /etc/chef/validation.pem <<'EOP'
-<%= validation_key %>
-EOP
-chmod 0600 /etc/chef/validation.pem
-
-<% if encrypted_data_bag_secret -%>
-cat > /etc/chef/encrypted_data_bag_secret <<'EOP'
-<%= encrypted_data_bag_secret %>
-EOP
-chmod 0600 /etc/chef/encrypted_data_bag_secret
-<% end -%>
-
-<%# Generate Ohai Hints -%>
-<% unless @chef_config[:knife][:hints].nil? || @chef_config[:knife][:hints].empty? -%>
-mkdir -p /etc/chef/ohai/hints
-
-<% @chef_config[:knife][:hints].each do |name, hash| -%>
-cat > /etc/chef/ohai/hints/<%= name %>.json <<'EOP'
-<%= hash.to_json %>
-EOP
-<% end -%>
-<% end -%>
-
-cat > /etc/chef/client.rb <<'EOP'
-log_level :info
-log_location STDOUT
-chef_server_url "<%= @chef_config[:chef_server_url] %>"
-validation_client_name "<%= @chef_config[:validation_client_name] %>"
-<% if @config[:chef_node_name] -%>
-node_name "<%= @config[:chef_node_name] %>"
-<% else -%>
-# Using default node name (fqdn)
-<% end -%>
-# ArchLinux follows the Filesystem Hierarchy Standard
-file_cache_path "/var/cache/chef"
-file_backup_path "/var/lib/chef/backup"
-pid_file "/var/run/chef/client.pid"
-cache_options({ :path => "/var/cache/chef/checksums", :skip_expires => true})
-<% if knife_config[:bootstrap_proxy] %>
-http_proxy "<%= knife_config[:bootstrap_proxy] %>"
-https_proxy "<%= knife_config[:bootstrap_proxy] %>"
-<% end -%>
-EOP
-
-cat > /etc/chef/first-boot.json <<'EOP'
-<%= first_boot.to_json %>
-EOP
-
-<%= start_chef %>'
diff --git a/lib/chef/knife/bootstrap/centos5-gems.erb b/lib/chef/knife/bootstrap/centos5-gems.erb
deleted file mode 100644
index 6aacc47179..0000000000
--- a/lib/chef/knife/bootstrap/centos5-gems.erb
+++ /dev/null
@@ -1,62 +0,0 @@
-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
- rpm -Uvh aegisco-rhel.rpm
-
- yum install -y ruby ruby-devel gcc gcc-c++ automake autoconf make
-
- 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
-gem update
-gem install ohai --no-rdoc --no-ri --verbose
-gem install chef --no-rdoc --no-ri --verbose <%= bootstrap_version_string %>
-
-mkdir -p /etc/chef
-
-cat > /etc/chef/validation.pem <<'EOP'
-<%= validation_key %>
-EOP
-chmod 0600 /etc/chef/validation.pem
-
-<% if encrypted_data_bag_secret -%>
-cat > /etc/chef/encrypted_data_bag_secret <<'EOP'
-<%= encrypted_data_bag_secret %>
-EOP
-chmod 0600 /etc/chef/encrypted_data_bag_secret
-<% end -%>
-
-<%# Generate Ohai Hints -%>
-<% unless @chef_config[:knife][:hints].nil? || @chef_config[:knife][:hints].empty? -%>
-mkdir -p /etc/chef/ohai/hints
-
-<% @chef_config[:knife][:hints].each do |name, hash| -%>
-cat > /etc/chef/ohai/hints/<%= name %>.json <<'EOP'
-<%= hash.to_json %>
-EOP
-<% end -%>
-<% end -%>
-
-cat > /etc/chef/client.rb <<'EOP'
-<%= config_content %>
-EOP
-
-cat > /etc/chef/first-boot.json <<'EOP'
-<%= first_boot.to_json %>
-EOP
-
-<%= start_chef %>'
diff --git a/lib/chef/knife/bootstrap/chef-full.erb b/lib/chef/knife/bootstrap/chef-full.erb
index c953a7e433..a4e85b9d67 100644
--- a/lib/chef/knife/bootstrap/chef-full.erb
+++ b/lib/chef/knife/bootstrap/chef-full.erb
@@ -23,7 +23,6 @@ exists() {
<%= knife_config[:bootstrap_install_command] %>
<% else %>
install_sh="<%= knife_config[:bootstrap_url] ? knife_config[:bootstrap_url] : "https://www.opscode.com/chef/install.sh" %>"
- version_string="-v <%= chef_version %>"
if ! exists /usr/bin/chef-client; then
echo "Installing Chef Client..."
if exists wget; then
diff --git a/lib/chef/knife/bootstrap/fedora13-gems.erb b/lib/chef/knife/bootstrap/fedora13-gems.erb
deleted file mode 100644
index 0aabc31085..0000000000
--- a/lib/chef/knife/bootstrap/fedora13-gems.erb
+++ /dev/null
@@ -1,44 +0,0 @@
-bash -c '
-<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%>
-
-yum install -y ruby ruby-devel gcc gcc-c++ automake autoconf rubygems make
-
-gem update --system
-gem update
-gem install ohai --no-rdoc --no-ri --verbose
-gem install chef --no-rdoc --no-ri --verbose <%= bootstrap_version_string %>
-
-mkdir -p /etc/chef
-
-cat > /etc/chef/validation.pem <<'EOP'
-<%= validation_key %>
-EOP
-chmod 0600 /etc/chef/validation.pem
-
-<% if encrypted_data_bag_secret -%>
-cat > /etc/chef/encrypted_data_bag_secret <<'EOP'
-<%= encrypted_data_bag_secret %>
-EOP
-chmod 0600 /etc/chef/encrypted_data_bag_secret
-<% end -%>
-
-<%# Generate Ohai Hints -%>
-<% unless @chef_config[:knife][:hints].nil? || @chef_config[:knife][:hints].empty? -%>
-mkdir -p /etc/chef/ohai/hints
-
-<% @chef_config[:knife][:hints].each do |name, hash| -%>
-cat > /etc/chef/ohai/hints/<%= name %>.json <<'EOP'
-<%= hash.to_json %>
-EOP
-<% end -%>
-<% end -%>
-
-cat > /etc/chef/client.rb <<'EOP'
-<%= config_content %>
-EOP
-
-cat > /etc/chef/first-boot.json <<'EOP'
-<%= first_boot.to_json %>
-EOP
-
-<%= start_chef %>'
diff --git a/lib/chef/knife/bootstrap/ubuntu10.04-apt.erb b/lib/chef/knife/bootstrap/ubuntu10.04-apt.erb
deleted file mode 100644
index 4549b94d2b..0000000000
--- a/lib/chef/knife/bootstrap/ubuntu10.04-apt.erb
+++ /dev/null
@@ -1,53 +0,0 @@
-bash -c '
-<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%>
-
-if [ ! -f /usr/bin/chef-client ]; then
- apt-get install -y wget
- echo "chef chef/chef_server_url string <%= @chef_config[:chef_server_url] %>" | debconf-set-selections
- [ -f /etc/apt/sources.list.d/opscode.list ] || echo "deb http://apt.opscode.com <%= chef_version.to_f == 0.10 ? "lucid-0.10" : "lucid" %> main" > /etc/apt/sources.list.d/opscode.list
- wget <%= "--proxy=on " if knife_config[:bootstrap_proxy] %>-O- http://apt.opscode.com/packages@opscode.com.gpg.key | apt-key add -
-fi
-apt-get update
-apt-get install -y chef
-
-cat > /etc/chef/validation.pem <<'EOP'
-<%= validation_key %>
-EOP
-chmod 0600 /etc/chef/validation.pem
-
-<% if encrypted_data_bag_secret -%>
-cat > /etc/chef/encrypted_data_bag_secret <<'EOP'
-<%= encrypted_data_bag_secret %>
-EOP
-chmod 0600 /etc/chef/encrypted_data_bag_secret
-<% end -%>
-
-<%# Generate Ohai Hints -%>
-<% unless @chef_config[:knife][:hints].nil? || @chef_config[:knife][:hints].empty? -%>
-mkdir -p /etc/chef/ohai/hints
-
-<% @chef_config[:knife][:hints].each do |name, hash| -%>
-cat > /etc/chef/ohai/hints/<%= name %>.json <<'EOP'
-<%= hash.to_json %>
-EOP
-<% end -%>
-<% end -%>
-
-<% unless @chef_config[:validation_client_name] == "chef-validator" -%>
-[ `grep -qx "validation_client_name \"<%= @chef_config[:validation_client_name] %>\"" /etc/chef/client.rb` ] || echo "validation_client_name \"<%= @chef_config[:validation_client_name] %>\"" >> /etc/chef/client.rb
-<% end -%>
-
-<% if @config[:chef_node_name] %>
-[ `grep -qx "node_name \"<%= @config[:chef_node_name] %>\"" /etc/chef/client.rb` ] || echo "node_name \"<%= @config[:chef_node_name] %>\"" >> /etc/chef/client.rb
-<% end -%>
-
-<% if knife_config[:bootstrap_proxy] %>
-echo 'http_proxy "knife_config[:bootstrap_proxy]"' >> /etc/chef/client.rb
-echo 'https_proxy "knife_config[:bootstrap_proxy]"' >> /etc/chef/client.rb
-<% end -%>
-
-cat > /etc/chef/first-boot.json <<'EOP'
-<%= first_boot.to_json %>
-EOP
-
-<%= start_chef %>'
diff --git a/lib/chef/knife/bootstrap/ubuntu10.04-gems.erb b/lib/chef/knife/bootstrap/ubuntu10.04-gems.erb
deleted file mode 100644
index 62ff7c857e..0000000000
--- a/lib/chef/knife/bootstrap/ubuntu10.04-gems.erb
+++ /dev/null
@@ -1,48 +0,0 @@
-bash -c '
-<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%>
-
-if [ ! -f /usr/bin/chef-client ]; then
- apt-get update
- apt-get install -y ruby ruby1.8-dev build-essential wget libruby-extras libruby1.8-extras
- 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)
-fi
-
-gem update --no-rdoc --no-ri
-gem install ohai --no-rdoc --no-ri --verbose
-gem install chef --no-rdoc --no-ri --verbose <%= bootstrap_version_string %>
-
-mkdir -p /etc/chef
-
-cat > /etc/chef/validation.pem <<'EOP'
-<%= validation_key %>
-EOP
-chmod 0600 /etc/chef/validation.pem
-
-<% if encrypted_data_bag_secret -%>
-cat > /etc/chef/encrypted_data_bag_secret <<'EOP'
-<%= encrypted_data_bag_secret %>
-EOP
-chmod 0600 /etc/chef/encrypted_data_bag_secret
-<% end -%>
-
-<%# Generate Ohai Hints -%>
-<% unless @chef_config[:knife][:hints].nil? || @chef_config[:knife][:hints].empty? -%>
-mkdir -p /etc/chef/ohai/hints
-
-<% @chef_config[:knife][:hints].each do |name, hash| -%>
-cat > /etc/chef/ohai/hints/<%= name %>.json <<'EOP'
-<%= hash.to_json %>
-EOP
-<% end -%>
-<% end -%>
-
-cat > /etc/chef/client.rb <<'EOP'
-<%= config_content %>
-EOP
-
-cat > /etc/chef/first-boot.json <<'EOP'
-<%= first_boot.to_json %>
-EOP
-
-<%= start_chef %>'
diff --git a/lib/chef/knife/bootstrap/ubuntu12.04-gems.erb b/lib/chef/knife/bootstrap/ubuntu12.04-gems.erb
deleted file mode 100644
index 8e9c6583d0..0000000000
--- a/lib/chef/knife/bootstrap/ubuntu12.04-gems.erb
+++ /dev/null
@@ -1,46 +0,0 @@
-bash -c '
-<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%>
-
-if [ ! -f /usr/bin/chef-client ]; then
- aptitude update
- aptitude install -y ruby ruby1.8-dev build-essential wget libruby1.8 rubygems
-fi
-
-gem update --no-rdoc --no-ri
-gem install ohai --no-rdoc --no-ri --verbose
-gem install chef --no-rdoc --no-ri --verbose <%= bootstrap_version_string %>
-
-mkdir -p /etc/chef
-
-cat > /etc/chef/validation.pem <<'EOP'
-<%= validation_key %>
-EOP
-chmod 0600 /etc/chef/validation.pem
-
-<% if encrypted_data_bag_secret -%>
-cat > /etc/chef/encrypted_data_bag_secret <<'EOP'
-<%= encrypted_data_bag_secret %>
-EOP
-chmod 0600 /etc/chef/encrypted_data_bag_secret
-<% end -%>
-
-<%# Generate Ohai Hints -%>
-<% unless @chef_config[:knife][:hints].nil? || @chef_config[:knife][:hints].empty? -%>
-mkdir -p /etc/chef/ohai/hints
-
-<% @chef_config[:knife][:hints].each do |name, hash| -%>
-cat > /etc/chef/ohai/hints/<%= name %>.json <<'EOP'
-<%= hash.to_json %>
-EOP
-<% end -%>
-<% end -%>
-
-cat > /etc/chef/client.rb <<'EOP'
-<%= config_content %>
-EOP
-
-cat > /etc/chef/first-boot.json <<'EOP'
-<%= first_boot.to_json %>
-EOP
-
-<%= start_chef %>'
diff --git a/lib/chef/knife/core/bootstrap_context.rb b/lib/chef/knife/core/bootstrap_context.rb
index 742ef226a3..aa6bbb7f5c 100644
--- a/lib/chef/knife/core/bootstrap_context.rb
+++ b/lib/chef/knife/core/bootstrap_context.rb
@@ -34,14 +34,6 @@ class Chef
@chef_config = chef_config
end
- def bootstrap_version_string
- if @config[:prerelease]
- "--prerelease"
- else
- "--version #{chef_version}"
- end
- end
-
def bootstrap_environment
@chef_config[:environment] || '_default'
end
@@ -93,7 +85,7 @@ CONFIG
client_path = @chef_config[:chef_client_path] || 'chef-client'
s = "#{client_path} -j /etc/chef/first-boot.json"
s << ' -l debug' if @config[:verbosity] and @config[:verbosity] >= 2
- s << " -E #{bootstrap_environment}" if chef_version.to_f != 0.9 # only use the -E option on Chef 0.10+
+ s << " -E #{bootstrap_environment}"
s
end
@@ -102,14 +94,6 @@ CONFIG
end
#
- # This function is used by older bootstrap templates other than chef-full
- # and potentially by custom templates as well hence it's logic needs to be
- # preserved for backwards compatibility reasons until we hit Chef 12.
- def chef_version
- knife_config[:bootstrap_version] || Chef::VERSION
- end
-
- #
# chef version string to fetch the latest current version from omnitruck
# If user is on X.Y.Z bootstrap will use the latest X release
# X here can be 10 or 11