|
@@ -1,5 +1,8 @@
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
+# To generate script:
|
|
|
+# ~/.local/bin/gengetoptions embed run_policy.sh.template > run_policy.sh
|
|
|
+
|
|
|
# @getoptions
|
|
|
parser_definition() {
|
|
|
setup REST help:usage -- "Usage: run_policy [options]... [arguments]" ''
|
|
@@ -94,9 +97,11 @@ parse "$@"
|
|
|
|
|
|
eval "set -- ${REST}"
|
|
|
|
|
|
+set -e
|
|
|
# Ref:
|
|
|
# https://medium.com/@emachnic/using-policyfiles-with-chef-client-local-mode-4f47477b24db
|
|
|
./scripts/export_policy.sh ${POLICY}
|
|
|
+echo -e "\n\e[4m\e[33mRunning:\e[0m \e[33m\e[1mchef-client -z\e[39m"
|
|
|
pushd policy-export > /dev/null
|
|
|
if [ ${DRY_RUN} -eq 1 ]; then
|
|
|
OPT="--why-run"
|