gate the minion data cache refresh events.

This commit is contained in:
David Boucha 2018-01-09 15:52:16 -07:00
parent fb87010461
commit a82e158f2d
No known key found for this signature in database
GPG Key ID: 6EB4B363C1E85114
4 changed files with 24 additions and 2 deletions

View File

@ -973,6 +973,22 @@ a minion performs an authentication check with the master.
auth_events: True
.. conf_master:: minion_data_cache_events
``minion_data_cache_events``
--------------------
.. versionadded:: 2017.7.3
Default: ``True``
Determines whether the master will fire minion data cache events. Minion data
cache events are fired when a minion requests a minion data cache refresh.
.. code-block:: yaml
minion_data_cache_events: True
.. _salt-ssh-configuration:
Salt-SSH Configuration

View File

@ -1087,6 +1087,9 @@ VALID_OPTS = {
# Whether to fire auth events
'auth_events': bool,
# Whether to fire Minion data cache refresh events
'minion_data_cache_events': bool,
}
# default configurations
@ -1654,6 +1657,7 @@ DEFAULT_MASTER_OPTS = {
'drop_messages_signature_fail': False,
'schedule': {},
'auth_events': True,
'minion_data_cache_events': True,
}

View File

@ -741,7 +741,8 @@ class RemoteFuncs(object):
self.cache.store('minions/{0}'.format(load['id']),
'data',
{'grains': load['grains'], 'pillar': data})
self.event.fire_event('Minion data cache refresh', tagify(load['id'], 'refresh', 'minion'))
if self.opts.get('minion_data_cache_events') is True:
self.event.fire_event('Minion data cache refresh', tagify(load['id'], 'refresh', 'minion'))
return data
def _minion_event(self, load):

View File

@ -1355,7 +1355,8 @@ class AESFuncs(object):
'data',
{'grains': load['grains'],
'pillar': data})
self.event.fire_event({'Minion data cache refresh': load['id']}, tagify(load['id'], 'refresh', 'minion'))
if salt.opts.get('minion_data_cache_events') is True:
self.event.fire_event({'Minion data cache refresh': load['id']}, tagify(load['id'], 'refresh', 'minion'))
return data
def _minion_event(self, load):