mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
add refresh_beacons and sync_beacons
This allows them to be used in the gitfs too in /srv/salt/_beacons
This commit is contained in:
parent
61c922ea1a
commit
4a94b2c17b
1 changed files with 38 additions and 0 deletions
|
@ -245,6 +245,25 @@ def update(version=None):
|
|||
return ret
|
||||
|
||||
|
||||
def sync_beacons(saltenv=None, refresh=True):
|
||||
'''
|
||||
Sync the beacons from the _beacons directory on the salt master file
|
||||
server. This function is environment aware, pass the desired environment
|
||||
to grab the contents of the _beacons directory, base is the default
|
||||
environment.
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' saltutil.sync_beacons
|
||||
'''
|
||||
ret = _sync('beacons', saltenv)
|
||||
if refresh:
|
||||
refresh_beacons()
|
||||
return ret
|
||||
|
||||
|
||||
def sync_modules(saltenv=None, refresh=True):
|
||||
'''
|
||||
Sync the modules from the _modules directory on the salt master file
|
||||
|
@ -395,6 +414,7 @@ def sync_all(saltenv=None, refresh=True):
|
|||
'''
|
||||
log.debug('Syncing all')
|
||||
ret = {}
|
||||
ret['beacons'] = sync_beacons(saltenv, False)
|
||||
ret['modules'] = sync_modules(saltenv, False)
|
||||
ret['states'] = sync_states(saltenv, False)
|
||||
ret['grains'] = sync_grains(saltenv, False)
|
||||
|
@ -407,6 +427,24 @@ def sync_all(saltenv=None, refresh=True):
|
|||
return ret
|
||||
|
||||
|
||||
def refresh_beacons():
|
||||
'''
|
||||
Signal the minion to refresh the beacons.
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' saltutil.refresh_beacons
|
||||
'''
|
||||
try:
|
||||
ret = __salt__['event.fire']({}, 'beacons_refresh')
|
||||
except KeyError:
|
||||
log.error('Event module not available. Module refresh failed.')
|
||||
ret = False # Effectively a no-op, since we can't really return without an event system
|
||||
return ret
|
||||
|
||||
|
||||
def refresh_pillar():
|
||||
'''
|
||||
Signal the minion to refresh the pillar data.
|
||||
|
|
Loading…
Add table
Reference in a new issue