Skip to content

Instantly share code, notes, and snippets.

@mrlesmithjr
Created August 2, 2017 05:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mrlesmithjr/afefbc00688e7038dac2bb9a131d1242 to your computer and use it in GitHub Desktop.
Save mrlesmithjr/afefbc00688e7038dac2bb9a131d1242 to your computer and use it in GitHub Desktop.
---
_ssh_keys_distribution:
{% for host in play_hosts %}
- host: '{{ host }}'
keys:
{% for _keys in hostvars[host]['_ssh_pub_key']['results'] %}
- user: '{{ _keys['item'] }}'
key: '{{ _keys['stdout'] }}'
{% endfor %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment