Skip to content

Instantly share code, notes, and snippets.

@mindware
Created March 7, 2015 07:46
Show Gist options
  • Save mindware/9fbfcc94abde630aa88c to your computer and use it in GitHub Desktop.
Save mindware/9fbfcc94abde630aa88c to your computer and use it in GitHub Desktop.
Distribute your SSH-keys to all your hosts using Ansible
ansible -i ~/ansible/hosts -m authorized_key -a "key='{{ lookup('file', '/home/YOURUSER/.ssh/id_rsa.pub') }}' user=YOURUSER" -u YOURUSER all -k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment