ansible-playbooks/tasks/ssh_config.yaml

19 lines
493 B
YAML
Raw Normal View History

2024-12-22 17:55:26 +01:00
- name: Configure SSH
hosts: inferencehosts
2024-11-23 20:58:45 +01:00
tasks:
- name: Set authorized key taken from file
ansible.posix.authorized_key:
2024-12-22 17:55:26 +01:00
user: joyeuse
key: "{{ lookup('file', '../config/id_ed25519.pub') }}"
2024-11-23 20:58:45 +01:00
- name: Copy over SSHD config file
ansible.builtin.copy:
2024-12-22 17:55:26 +01:00
src: ../config/sshd_config
2024-11-23 20:58:45 +01:00
dest: /etc/ssh/sshd_config
owner: root
group: root
mode: '0600'
- name: Restart SSHD
service:
name: sshd
state: restarted