Skip to content

Instantly share code, notes, and snippets.

Created May 28, 2015 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/7b946a5b98e560436f7e to your computer and use it in GitHub Desktop.
Save anonymous/7b946a5b98e560436f7e to your computer and use it in GitHub Desktop.
/srv/reactor/auth-pending.sls
~
"/srv/reactor/auth-pending.sls
{# rs_ server faild to authenticate -- remove accepted key #}
{% if not data['result'] and data['id'].startswith('ink') %}
minion_remove:
wheel.key.delete:
- match: {{ data['id'] }}
minion_rejoin:
local.cmd.run:
- tgt: salt-master.domain.tld
- arg:
- ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "{{ data['id'] }}" 'sleep 10 && /etc/init.d/salt-minion restart'
{% endif %}
{# Ink server is sending new key -- accept this key #}
{% if 'act' in data and data['act'] == 'pend' and data['id'].startswith('rs_') %}
minion_add:
wheel.key.accept:
- match: {{ data['id'] }}
{% endif %}
~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment