Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@lordcirth
Created April 5, 2017 18:27
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 lordcirth/1555dc7642df5d6a500180b19296de30 to your computer and use it in GitHub Desktop.
Save lordcirth/1555dc7642df5d6a500180b19296de30 to your computer and use it in GitHub Desktop.
master: {{pillar['common']['salt_master']}}
hash_type: sha256
# Salt Mine - retrieves data from minions to master
mine_functions:
ssh.host_keys:
# Only send pubkeys - very important!
private: False
{# From gtmanfred on #salt #}
{% for minion_id, keys in salt['mine.get']('*', 'ssh.host_keys').items() %}
{# assuming that minion_id == fqdn #}
{{ minion_id }} {{ keys['ecdsa.pub'] }}
{{ minion_id.split('.')[0] }} {{ keys['ecdsa.pub'] }}
{{ minion_id }} {{ keys['rsa.pub'] }}
{{ minion_id.split('.')[0] }} {{ keys['rsa.pub'] }}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment