diff --git a/salt-formula-manager.py b/salt-formula-manager.py index 5ac00f3..a73857f 100644 --- a/salt-formula-manager.py +++ b/salt-formula-manager.py @@ -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() diff --git a/sfm.yaml.example b/sfm.yaml.example index 637c1ce..27652ae 100644 --- a/sfm.yaml.example +++ b/sfm.yaml.example @@ -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