mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Merge pull request #16358 from cachedout/gate_minion_cache
Flag to preserve minion cache on key delete
This commit is contained in:
commit
7001e20441
@ -137,6 +137,14 @@
|
|||||||
# 'aes_key_rotate' event with the 'key' tag and acting appropriately.
|
# 'aes_key_rotate' event with the 'key' tag and acting appropriately.
|
||||||
# ping_on_rotate: False
|
# ping_on_rotate: False
|
||||||
|
|
||||||
|
# By default, the master deletes its cache of minion data when the key for that
|
||||||
|
# minion is removed. To preserve the cache after key deletion, set
|
||||||
|
# 'preserve_minion_cache' to True.
|
||||||
|
#
|
||||||
|
# WARNING: This may have security implications if compromised minions auth with
|
||||||
|
# a previous deleted minion ID.
|
||||||
|
#preserve_minion_cache: False
|
||||||
|
|
||||||
# If max_minions is used in large installations, the master might experience
|
# If max_minions is used in large installations, the master might experience
|
||||||
# high-load situations because of having to check the number of connected
|
# high-load situations because of having to check the number of connected
|
||||||
# minions for every authentication. This cache provides the minion-ids of
|
# minions for every authentication. This cache provides the minion-ids of
|
||||||
|
@ -186,6 +186,7 @@ VALID_OPTS = {
|
|||||||
'pillar_source_merging_strategy': str,
|
'pillar_source_merging_strategy': str,
|
||||||
'ping_on_key_rotate': bool,
|
'ping_on_key_rotate': bool,
|
||||||
'peer': dict,
|
'peer': dict,
|
||||||
|
'preserve_minion_cache': bool,
|
||||||
'syndic_master': str,
|
'syndic_master': str,
|
||||||
'runner_dirs': list,
|
'runner_dirs': list,
|
||||||
'client_acl': dict,
|
'client_acl': dict,
|
||||||
@ -474,6 +475,7 @@ DEFAULT_MASTER_OPTS = {
|
|||||||
'pillar_source_merging_strategy': 'smart',
|
'pillar_source_merging_strategy': 'smart',
|
||||||
'ping_on_key_rotate': False,
|
'ping_on_key_rotate': False,
|
||||||
'peer': {},
|
'peer': {},
|
||||||
|
'preserve_minion_cache': False,
|
||||||
'syndic_master': '',
|
'syndic_master': '',
|
||||||
'runner_dirs': [],
|
'runner_dirs': [],
|
||||||
'outputter_dirs': [],
|
'outputter_dirs': [],
|
||||||
|
@ -475,6 +475,7 @@ class Key(object):
|
|||||||
minions = []
|
minions = []
|
||||||
for key, val in keys.items():
|
for key, val in keys.items():
|
||||||
minions.extend(val)
|
minions.extend(val)
|
||||||
|
if self.opts.get('preserve_minion_cache', False):
|
||||||
for minion in os.listdir(m_cache):
|
for minion in os.listdir(m_cache):
|
||||||
if minion not in minions:
|
if minion not in minions:
|
||||||
shutil.rmtree(os.path.join(m_cache, minion))
|
shutil.rmtree(os.path.join(m_cache, minion))
|
||||||
|
Loading…
Reference in New Issue
Block a user