From e0408de463ab9b2138d11f39fadf0034fe7eb830 Mon Sep 17 00:00:00 2001 From: sawanoboly Date: Tue, 19 Nov 2019 14:59:13 +0900 Subject: add bootstrap_project for install cinc Signed-off-by: sawanoboly Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. Signed-off-by: sawanoboly resolv indent Signed-off-by: sawanoboly --- lib/chef/knife/bootstrap.rb | 6 ++++++ lib/chef/knife/bootstrap/templates/chef-full.erb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb index d4e98e3dec..89192cd76f 100644 --- a/lib/chef/knife/bootstrap.rb +++ b/lib/chef/knife/bootstrap.rb @@ -296,6 +296,12 @@ class Chef description: "URL to a custom installation script.", proc: Proc.new { |u| Chef::Config[:knife][:bootstrap_url] = u } + option :bootstrap_project, + long: "--bootstrap-project PROJECT", + description: "Project to install.", + proc: Proc.new { |u| Chef::Config[:knife][:bootstrap_project] = u }, + default: "chef" + option :msi_url, # Windows target only short: "-m URL", long: "--msi-url URL", diff --git a/lib/chef/knife/bootstrap/templates/chef-full.erb b/lib/chef/knife/bootstrap/templates/chef-full.erb index b0476c8d57..66516b128a 100644 --- a/lib/chef/knife/bootstrap/templates/chef-full.erb +++ b/lib/chef/knife/bootstrap/templates/chef-full.erb @@ -177,7 +177,7 @@ do_download() { else echo "-----> Installing Chef Omnibus (<%= @config[:channel] %>/<%= version_to_install %>)" do_download ${install_sh} $tmp_dir/install.sh - sh $tmp_dir/install.sh -P chef -c <%= @config[:channel] %> -v <%= version_to_install %> + sh $tmp_dir/install.sh -P <%= knife_config[:bootstrap_project] %> -c <%= @config[:channel] %> -v <%= version_to_install %> fi <% end %> -- cgit v1.2.1