Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - hosts: webservers
- remote_user: jack
- tasks:
- - name: fetch all public keys
- shell: cat ~/.ssh/id_rsa.pub
- register: ssh_keys
- tags:
- - ssh
- - name: check ssh public keys
- debug: msg="{{ ssh_keys.stdout }}"
- tags:
- - ssh
- - name: deploy ssh keys
- shell: echo {{ ssh_keys.stdout }} >> ~/.ssh/authorized_keys
- delegate_to: "{{ item }}"
- with_items:
- - "{{groups['webservers']}}"
- tags:
- - ssh
Add Comment
Please, Sign In to add comment