Skip to content

Instantly share code, notes, and snippets.

@dwdraju
Created July 19, 2018 10:02
Show Gist options
  • Save dwdraju/4966af03430c602c930f6431e0e3c908 to your computer and use it in GitHub Desktop.
Save dwdraju/4966af03430c602c930f6431e0e3c908 to your computer and use it in GitHub Desktop.
Ansible set ssh authorized keys to all hosts
- hosts: all
  become: true
  tasks:
   - name: Set authorized key taken from file
     authorized_key:
       user: ubuntu
       state: present
       key: "{{ lookup('file', '/home/ubuntu/new_id_rsa.pub') }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment