mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
parent
e41c5c2f52
commit
5f2103903d
3 changed files with 14 additions and 3 deletions
|
@ -137,6 +137,14 @@
|
|||
# 'aes_key_rotate' event with the 'key' tag and acting appropriately.
|
||||
# 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
|
||||
# high-load situations because of having to check the number of connected
|
||||
# minions for every authentication. This cache provides the minion-ids of
|
||||
|
|
|
@ -186,6 +186,7 @@ VALID_OPTS = {
|
|||
'pillar_source_merging_strategy': str,
|
||||
'ping_on_key_rotate': bool,
|
||||
'peer': dict,
|
||||
'preserve_minion_cache': bool,
|
||||
'syndic_master': str,
|
||||
'runner_dirs': list,
|
||||
'client_acl': dict,
|
||||
|
@ -474,6 +475,7 @@ DEFAULT_MASTER_OPTS = {
|
|||
'pillar_source_merging_strategy': 'smart',
|
||||
'ping_on_key_rotate': False,
|
||||
'peer': {},
|
||||
'preserve_minion_cache': False,
|
||||
'syndic_master': '',
|
||||
'runner_dirs': [],
|
||||
'outputter_dirs': [],
|
||||
|
|
|
@ -475,9 +475,10 @@ class Key(object):
|
|||
minions = []
|
||||
for key, val in keys.items():
|
||||
minions.extend(val)
|
||||
for minion in os.listdir(m_cache):
|
||||
if minion not in minions:
|
||||
shutil.rmtree(os.path.join(m_cache, minion))
|
||||
if self.opts.get('preserve_minion_cache', False):
|
||||
for minion in os.listdir(m_cache):
|
||||
if minion not in minions:
|
||||
shutil.rmtree(os.path.join(m_cache, minion))
|
||||
|
||||
def check_master(self):
|
||||
'''
|
||||
|
|
Loading…
Add table
Reference in a new issue