Guest User

Untitled

a guest
Dec 12th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. - hosts: webservers
  2. remote_user: jack
  3.  
  4. tasks:
  5. - name: fetch all public keys
  6. shell: cat ~/.ssh/id_rsa.pub
  7. register: ssh_keys
  8. tags:
  9. - ssh
  10.  
  11. - name: check ssh public keys
  12. debug: msg="{{ ssh_keys.stdout }}"
  13. tags:
  14. - ssh
  15.  
  16. - name: deploy ssh keys
  17. shell: echo {{ ssh_keys.stdout }} >> ~/.ssh/authorized_keys
  18. delegate_to: "{{ item }}"
  19. with_items:
  20. - "{{groups['webservers']}}"
  21. tags:
  22. - ssh
Add Comment
Please, Sign In to add comment