Browse Source

Authorize with local SSH key

Ansible's lookup function is used to get files outside the project
directory.
remove-logs
Andreas Linz 3 years ago
parent
commit
f838caf9cd
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      roles/common/tasks/main.yml

+ 7
- 1
roles/common/tasks/main.yml View File

@ -39,4 +39,10 @@
append: true
groups: wheel
# http://docs.ansible.com/ansible/user_module.html
password: "{{ user_password }}"
password: "{{ user_password }}"
- name: Authorize SSH key
authorized_key:
user: "{{ user_name }}"
state: present
key: "{{ lookup('file', '~/.ssh/id_kn_rsa.pub') }}"
become: true

Loading…
Cancel
Save