Skip to content

Instantly share code, notes, and snippets.

@chuckersjp
Created August 9, 2018 02:34
Show Gist options
  • Save chuckersjp/77863ce1d27b12d1da288e589aabf24e to your computer and use it in GitHub Desktop.
Save chuckersjp/77863ce1d27b12d1da288e589aabf24e to your computer and use it in GitHub Desktop.
Ansible command to push out keys to all hosts. Requires that the account be present and the password be the same.
ansible -i inventory all -m authorized_key -a "user=ansible key={{ lookup('file', '/home/ansible/.ssh/id_rsa.pub') }}" -k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment