ansible/roles/sshd/tasks/main.yml

31 lines
668 B
YAML

- name: set rilla's authorized key
authorized_key:
user: rilla
key: '{{ item }}'
path: /home/rilla/.ssh/authorized_keys
with_file:
- public_keys/yubikey
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
- 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"