Selaa lähdekoodia

Add the dry run

Signed-off-by: Jeremy MAURO <jeremy.mauro@gmail.com>
Jeremy MAURO 3 vuotta sitten
vanhempi
commit
9643d5f99b
1 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  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