Browse Source

feat(export): Give the possibility to select the policy to export

Signed-off-by: Jeremy MAURO <jeremy.mauro@gmail.com>
Jeremy MAURO 2 years ago
parent
commit
e0812c3deb
1 changed files with 3 additions and 2 deletions
  1. 3 2
      scripts/export_policy.sh

+ 3 - 2
scripts/export_policy.sh

@@ -2,9 +2,10 @@
 
 # Ref:
 # 	https://medium.com/@emachnic/using-policyfiles-with-chef-client-local-mode-4f47477b24db
+POLICY=${1:-"base"}
 rm -rf policy-export/*
-bundle exec chef-cli update base.rb 
-bundle exec chef-cli export base.rb -a policy-export
+bundle exec chef-cli update "${POLICY}.rb"
+bundle exec chef-cli export "${POLICY}.rb" -a policy-export
 pushd policy-export > /dev/null
 tar xfz *.tgz && rm -rf *.tgz
 popd > /dev/null