Added ability to purge unmanaged salt formulas

This commit is contained in:
Gregory Ballantine 2016-09-29 11:51:46 -04:00
parent 614758e4b0
commit 672be1929d
2 changed files with 14 additions and 0 deletions

View File

@ -57,6 +57,14 @@ def get_formulas(conf):
# clone git repo
Repo.clone_from(git_url, local_path)
# purge un-managed formulas
def clean_formulas(conf):
if conf['purge_formulas']:
print('Cleaning out unmanaged formulas')
else:
print('Not cleaning out unmanaged formulas')
# main program
def main():
# read configuration settings
@ -68,5 +76,8 @@ def main():
# do the formula stuff
get_formulas(conf)
# clean unmanaged formulas
clean_formulas(conf)
# run main
main()

View File

@ -6,6 +6,9 @@ formulas_url: https://github.com/saltstack-formulas/
# where to store the new formulas (relative to current directory)
formulas_dir: formulas
# remove unmanaged formulas
purge_formulas: true
# list of formulas to import
formulas:
- vim