diff --git a/salt/states/pkgrepo.py b/salt/states/pkgrepo.py index 7e2669820f..52609f346f 100644 --- a/salt/states/pkgrepo.py +++ b/salt/states/pkgrepo.py @@ -195,6 +195,10 @@ def managed(name, **kwargs): file. The consolidate will run every time the state is processed. The option only needs to be set on one repo managed by salt to take effect. + clean_file + If set to true, empty file before config repo, dangerous if use + multiple sources in one file. + refresh_db If set to false this will skip refreshing the apt package database on debian based systems. @@ -281,6 +285,10 @@ def managed(name, **kwargs): ret['comment'] = ('Package repo {0!r} already configured' .format(name)) return ret + + if kwargs.get('clean_file', False): + open(kwargs['file'], 'w').close() + if __opts__['test']: ret['comment'] = ('Package repo {0!r} will be configured. This may ' 'cause pkg states to behave differently than stated '