Skip to content

Instantly share code, notes, and snippets.

@eofs eofs/master
Last active Apr 10, 2019

Embed
What would you like to do?
Remove keys of disconnected Saltstack minions
# Enable "presence" events
# - http://docs.saltstack.com/en/latest/ref/configuration/master.html#presence-events
# - http://docs.saltstack.com/en/latest/topics/event/master_events.html#presence-events
presence_events: True
reactor:
# Note: This tag has a typo in it (version 2014.1.5), subject to change!
- 'salt/presense/change':
- /srv/reactor/presence.sls
{% for minion_id in data['lost'] %}
remove_unused_keys:
wheel.key.delete:
- match: {{ minion_id }}
{% endfor %}
@Inveracity

This comment has been minimized.

Copy link

commented Apr 25, 2017

to those that find this using google, here's an updated version without the typo from version 2014.1.5
the following is confirmed working in 2016.11.3:

reactor:
  - 'salt/presence/change':
    - /srv/reactor/presence.sls
{% for minion_id in data['lost'] %}
remove_unused_keys_{{ minion_id }}: # avoid duplicate key error
  wheel.key.delete:
    - match: {{ minion_id }}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.