mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #19561 from favadi/clean_file
add pkgrepo.managed clean_file option
This commit is contained in:
commit
8ec6d4a257
@ -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 '
|
||||
|
Loading…
Reference in New Issue
Block a user