configurations-ansible/ssh-copy-id.yml

13 lines
333 B
YAML

---
- hosts: "{{ target if target is defined else 'planets' }}"
tasks:
- name: "Copy ssh-copy-id given key and target user"
when:
- 'ssh_user is defined'
- 'ssh_copy_id is defined'
ansible.posix.authorized_key:
user: "{{ ssh_user }}"
state: present
key: "{{ ssh_copy_id }}"