lib/chef/fork/commands/bootstrap.rb in chef-fork-0.1.3 vs lib/chef/fork/commands/bootstrap.rb in chef-fork-0.1.4
- old
+ new
@@ -1,9 +1,10 @@
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require "chef"
+require "chef/config"
require "chef/knife/core/bootstrap_context"
require "erubis"
require "json"
require "shellwords"
require "chef/fork/commands/ssh"
@@ -34,14 +35,16 @@
options[:chef_node_name] = value
end
optparse.on("--bootstrap-version VERSION", "The version of Chef to install") do |value|
options[:bootstrap_version] = value
+ Chef::Config[:knife][:bootstrap_version] = value
end
optparse.on("--bootstrap-proxy PROXY_URL", "The proxy server for the node being bootstrapped") do |value|
options[:bootstrap_proxy] = value
+ Chef::Config[:knife][:bootstrap_proxy] = value
end
optparse.on("-d DISTRO", "--distro DISTRO", "Bootstrap a distro using a template") do |value|
options[:distro] = value
end
@@ -62,13 +65,15 @@
options[:first_boot_attributes] = options[:first_boot_attributes].merge(JSON.parse(value))
end
optparse.on("-s SECRET", "--secret SECRET", "The secret key to use to encrypt data bag item values") do |value|
options[:secret] = value
+ Chef::Config[:knife][:secret] = value
end
optparse.on("--secret-file SECRET_FILE", "A file containing the secret key to use to encrypt data bag item values") do |value|
options[:secret_file] = value
+ Chef::Config[:knife][:secret_file] = value
end
end
def bootstrap_command()
template_file = options[:template_file] || find_template(options[:distro])