Skip to content

Instantly share code, notes, and snippets.

@alex-zel
Created February 16, 2017 12: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 alex-zel/6cf6d0c38d35d3c13b6e173f74d51137 to your computer and use it in GitHub Desktop.
Save alex-zel/6cf6d0c38d35d3c13b6e173f74d51137 to your computer and use it in GitHub Desktop.
cmd.run:
- name: ssh-keygen -q -N '' -f /root/.ssh/id_rsa
- runas: root
- unless: test -f /root/.ssh/id_rsa
event.send:
- name: attic/update/pub_key
- pub_key: {{ salt['ssh.user_keys']('root')['root']['id_rsa.pub'].split(' ')[1] }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment