ansible-playbooks/tasks/ssh_config.yaml
2024-12-22 17:55:26 +01:00

18 lines
493 B
YAML

- name: Configure SSH
hosts: inferencehosts
tasks:
- name: Set authorized key taken from file
ansible.posix.authorized_key:
user: joyeuse
key: "{{ lookup('file', '../config/id_ed25519.pub') }}"
- name: Copy over SSHD config file
ansible.builtin.copy:
src: ../config/sshd_config
dest: /etc/ssh/sshd_config
owner: root
group: root
mode: '0600'
- name: Restart SSHD
service:
name: sshd
state: restarted