run_policy.sh 375 B

1234567891011121314
  1. #!/usr/bin/env bash
  2. # Ref:
  3. # https://medium.com/@emachnic/using-policyfiles-with-chef-client-local-mode-4f47477b24db
  4. ./scripts/export_policy.sh
  5. pushd policy-export > /dev/null
  6. if [ "$1" = "dry" ]; then
  7. OPT="--why-run"
  8. elif [ "$1" = "debug" ]; then
  9. OPT="--log_level debug"
  10. fi
  11. bundle exec chef-client --chef-license 'accept' -z ${OPT}
  12. popd > /dev/null
  13. ./scripts/end_run.sh