Skip to content

Instantly share code, notes, and snippets.

@mowings
Created January 27, 2020 20:03
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 mowings/fd9abd6144d8c11e80fbce9ee4b8ec7e to your computer and use it in GitHub Desktop.
Save mowings/fd9abd6144d8c11e80fbce9ee4b8ec7e to your computer and use it in GitHub Desktop.
Ansible -- add a bunch of public keys in a directory to a remote user
- name: Add keys to hosts
hosts: all
become: true
tasks:
- name: add keys
authorized_key:
user: ubuntu
state: present
key: "{{item}}"
with_file:
- keys/mary.pub
- keys/joe.pub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment