diff --git a/config-add-sshkey.yaml b/config-add-sshkey.yaml index 6c39626..81f84cb 100644 --- a/config-add-sshkey.yaml +++ b/config-add-sshkey.yaml @@ -1,6 +1,6 @@ --- - name: Add ssh key - hosts: "killer1" + hosts: all become: true tasks: @@ -12,7 +12,7 @@ ansible.posix.authorized_key: user: "{{ lookup('env', 'USER') }}" state: present - key: "/root/.ssh/id_rsa.pub" + key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}" - name: Change sudoers file ansible.builtin.lineinfile: