summaryrefslogtreecommitdiff
path: root/habitat/hooks/run
diff options
context:
space:
mode:
authorAdam Jacob <adam@chef.io>2016-12-21 09:58:31 -0800
committerAdam Jacob <adam@chef.io>2016-12-21 09:58:31 -0800
commit3efafd0be5ea54fc89de6d147106ffa1eedb395d (patch)
tree94aa2d3ce839e8b25ef7b209f8e04bef440d954d /habitat/hooks/run
parent03c3c222b1246b537e2121ec35330e685afee66a (diff)
downloadchef-3efafd0be5ea54fc89de6d147106ffa1eedb395d.tar.gz
Initial habitat planadamhjk/habitat
This is a simple initial habitat plan. It creates a chef-client service, which uses chef-solo to run cookbooks that are located in the default cache location. To build it yourself: * Install habitat * `hab studio build` You'll wind up with a habitat artifact in `results`. Signed-off-by: Adam Jacob <adam@chef.io>
Diffstat (limited to 'habitat/hooks/run')
-rw-r--r--habitat/hooks/run8
1 files changed, 8 insertions, 0 deletions
diff --git a/habitat/hooks/run b/habitat/hooks/run
new file mode 100644
index 0000000000..cbfa24ab62
--- /dev/null
+++ b/habitat/hooks/run
@@ -0,0 +1,8 @@
+#!/bin/sh
+export GEM_HOME="$(hab pkg path chef/chef-client)/ruby/2.3.0"
+export GEM_PATH="$(hab pkg path core/ruby)/lib/ruby/gems/2.3.0:$(hab pkg path core/bundler):$GEM_HOME"
+export APPBUNDLER_ALLOW_RVM=true
+
+exec 2>&1
+exec chef-solo --fork -i {{cfg.interval}} -s {{cfg.splay}} -l {{cfg.log_level}} -o {{cfg.run_list}}
+