You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
491 B

---
- name: Set up ssh
vars:
uid: "{{ lookup('env','USER') }}"
hosts: localhost
connection: local
become: false
tasks:
- name: Create ssh dir
ansible.builtin.file:
dest: "/home/{{ uid }}/.ssh"
state: directory
- name: Install authorized keys
ansible.builtin.template:
src: ../templates/authorized_keys.j2
dest: "/home/{{ uid }}/.ssh/authorized_keys"
owner: "{{ uid }}"
group: "{{ uid }}"
mode: '0600'