summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Cerny <ncerny@gmail.com>2019-05-28 16:02:04 -0500
committerNathan Cerny <ncerny@gmail.com>2019-05-28 16:02:04 -0500
commit9b542ef9a12ea66a769723718711d7dc0267a3f8 (patch)
tree9b74207e17de19bf6436d9d822fdd6e760b015b5
parentcc6c31616126c38d93dafd1f0475ac3ae5815a65 (diff)
downloadchef-9b542ef9a12ea66a769723718711d7dc0267a3f8.tar.gz
Update Habitat Build with license acceptance and make package more flexible.
Signed-off-by: Nathan Cerny <ncerny@gmail.com>
-rw-r--r--habitat/config/client.rb1
-rw-r--r--habitat/default.toml12
-rw-r--r--habitat/hooks/run8
3 files changed, 18 insertions, 3 deletions
diff --git a/habitat/config/client.rb b/habitat/config/client.rb
index 2d28d223c5..db38c62510 100644
--- a/habitat/config/client.rb
+++ b/habitat/config/client.rb
@@ -6,6 +6,7 @@ data_collector.token "{{cfg.data_collector.token}}"
data_collector.mode "{{cfg.data_collector.mode}}".to_sym
data_collector.raise_on_failure {{cfg.data_collector.raise_on_failure}}
minimal_ohai {{cfg.minimal_ohai}}
+local_mode {{cfg.local_mode}}
{{#if cfg.chef-client.node_name ~}}
node_name "{{cfg.node_name}}"
{{/if ~}}
diff --git a/habitat/default.toml b/habitat/default.toml
index 1422305835..2bea08934b 100644
--- a/habitat/default.toml
+++ b/habitat/default.toml
@@ -1,6 +1,14 @@
pid_file = "chef.pid"
run_list = ""
+local_mode = true
+
+# Positive License Acceptance. See https://docs.chef.io/chef_license_accept.html
+chef_license = "donotaccept"
+
+# Path to the chef client config on disk. If blank, will default to the one built by habitat.
+config_path = ""
+
# The location in which nodes are stored when the chef-client is run in local mode
log_location = "STDOUT"
@@ -18,11 +26,11 @@ minimal_ohai = false
# The name of the node. Determines which configuration should be applied and sets the client_name,
# which is the name used when authenticating to a Chef server. The default value is the FQDN of the chef-client,
-#as detected by Ohai. In general, Chef recommends that you leave this setting blank and let Ohai
+# as detected by Ohai. In general, Chef recommends that you leave this setting blank and let Ohai
# assign the FQDN of the node as the node_name during each chef-clientrun.
node_name = ""
-#The name of the environment
+# The name of the environment
environment = "_default"
use_member_id_as_uuid = false
diff --git a/habitat/hooks/run b/habitat/hooks/run
index 75dd1958fa..5016e612d9 100644
--- a/habitat/hooks/run
+++ b/habitat/hooks/run
@@ -3,4 +3,10 @@ exec 2>&1
export SSL_CERT_FILE="{{pkgPathFor "core/cacerts"}}/ssl/cert.pem"
-exec chef-solo --fork -c {{pkg.svc_config_path}}/client.rb
+if [[ -z "{{cfg.config_path}}" ]]; then
+ CLIENT_CONFIG="{{pkg.svc_config_path}}/client.rb"
+else
+ CLIENT_CONFIG="{{cfg.config_path}}/client.rb"
+fi
+
+exec chef-client --fork -c ${CLIENT_CONFIG}/client.rb --chef-license {{cfg.chef_license}}