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.
35 lines
949 B
35 lines
949 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'
|
|
- name: Install pub key
|
|
ansible.builtin.template:
|
|
src: ../templates/id_rsa_yubikey.pub.j2
|
|
dest: /home/{{ uid }}/.ssh/id_rsa_yubikey.pub
|
|
owner: '{{ uid }}'
|
|
group: '{{ uid }}'
|
|
mode: '0600'
|
|
- name: Install ssh config
|
|
ansible.builtin.template:
|
|
src: ../templates/ssh_config.j2
|
|
dest: /home/{{ uid }}/.ssh/config
|
|
owner: '{{ uid }}'
|
|
group: '{{ uid }}'
|
|
mode: '0600'
|
|
|