summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2019-06-14 09:29:36 -0700
committerGitHub <noreply@github.com>2019-06-14 09:29:36 -0700
commit8f1df5d76939947022bd00dc89db307b9a479f73 (patch)
tree23b8197b60a966630344de1b7c76eda7dfdc944d
parentb8afd52f1ad1fd19dc56817119daaef181a4fd92 (diff)
parentb4a5cc4ecb9545ff0ce20d81e3217d1909f916d6 (diff)
downloadchef-8f1df5d76939947022bd00dc89db307b9a479f73.tar.gz
Merge pull request #8598 from ncerny/nc/fix-habitat-plan
Update Habitat Build
-rw-r--r--habitat/config/client.rb1
-rw-r--r--habitat/default.toml12
-rw-r--r--habitat/hooks/run12
3 files changed, 22 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..598d609d7f 100644
--- a/habitat/hooks/run
+++ b/habitat/hooks/run
@@ -3,4 +3,14 @@ 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}}"
+else
+ CLIENT_CONFIG="{{cfg.config_path}}"
+fi
+
+if [[ "${CLIENT_CONFIG##*.}" != "rb" ]]; then
+ CLIENT_CONFIG=${CLIENT_CONFIG}/client.rb
+fi
+
+exec chef-client --fork -c ${CLIENT_CONFIG} --chef-license {{cfg.chef_license}}