Added ability to purge unmanaged salt formulas
This commit is contained in:
parent
614758e4b0
commit
672be1929d
@ -57,6 +57,14 @@ def get_formulas(conf):
|
|||||||
# clone git repo
|
# clone git repo
|
||||||
Repo.clone_from(git_url, local_path)
|
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
|
# main program
|
||||||
def main():
|
def main():
|
||||||
# read configuration settings
|
# read configuration settings
|
||||||
@ -68,5 +76,8 @@ def main():
|
|||||||
# do the formula stuff
|
# do the formula stuff
|
||||||
get_formulas(conf)
|
get_formulas(conf)
|
||||||
|
|
||||||
|
# clean unmanaged formulas
|
||||||
|
clean_formulas(conf)
|
||||||
|
|
||||||
# run main
|
# run main
|
||||||
main()
|
main()
|
||||||
|
@ -6,6 +6,9 @@ formulas_url: https://github.com/saltstack-formulas/
|
|||||||
# where to store the new formulas (relative to current directory)
|
# where to store the new formulas (relative to current directory)
|
||||||
formulas_dir: formulas
|
formulas_dir: formulas
|
||||||
|
|
||||||
|
# remove unmanaged formulas
|
||||||
|
purge_formulas: true
|
||||||
|
|
||||||
# list of formulas to import
|
# list of formulas to import
|
||||||
formulas:
|
formulas:
|
||||||
- vim
|
- vim
|
||||||
|
Loading…
Reference in New Issue
Block a user