summaryrefslogtreecommitdiff
path: root/habitat/chef-infra-client/hooks/run
diff options
context:
space:
mode:
Diffstat (limited to 'habitat/chef-infra-client/hooks/run')
-rw-r--r--habitat/chef-infra-client/hooks/run16
1 files changed, 16 insertions, 0 deletions
diff --git a/habitat/chef-infra-client/hooks/run b/habitat/chef-infra-client/hooks/run
new file mode 100644
index 0000000000..598d609d7f
--- /dev/null
+++ b/habitat/chef-infra-client/hooks/run
@@ -0,0 +1,16 @@
+#!/bin/sh
+exec 2>&1
+
+export SSL_CERT_FILE="{{pkgPathFor "core/cacerts"}}/ssl/cert.pem"
+
+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}}