ansible/roles/sshd/tasks/main.yml

31 lines
668 B
YAML
Raw Normal View History

2022-08-30 12:31:20 +02:00
- name: set rilla's authorized key
authorized_key:
user: rilla
key: '{{ item }}'
path: /home/rilla/.ssh/authorized_keys
with_file:
- public_keys/yubikey
2022-08-30 14:18:17 +02:00
register: rilla_keys
- name: set ansible's authorized keys
authorized_key:
user: ansible
key: '{{ item }}'
path: /var/lib/ansible/.ssh/authorized_keys
with_file:
- public_keys/yubikey
- public_keys/ansible
register: ansible_keys
2022-08-30 12:31:20 +02:00
- name: set sshd config
template:
src: sshd_config.j2
dest: /etc/ssh/sshd_config
mode: '0644'
owner: root
group: wheel
- name: setup alpine ssh
include_tasks: alpine.yml
when: ansible_distribution == "Alpine"