瀏覽代碼

Add the dry run

Signed-off-by: Jeremy MAURO <jeremy.mauro@gmail.com>
Jeremy MAURO 3 年之前
父節點
當前提交
9643d5f99b
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      scripts/run_policy.sh

+ 4 - 1
scripts/run_policy.sh

@@ -4,6 +4,9 @@
 # 	https://medium.com/@emachnic/using-policyfiles-with-chef-client-local-mode-4f47477b24db
 ./scripts/export_policy.sh
 pushd policy-export > /dev/null
-bundle exec chef-client --chef-license 'accept' -z
+if [ "$1" = "dry" ]; then
+	DRY="--why-run"
+fi
+bundle exec chef-client --chef-license 'accept' -z ${DRY}
 popd > /dev/null
 ./scripts/end_run.sh