2022-12-20 19:47:11 +01:00
|
|
|
---
|
|
|
|
# SSH must be installed so we don't bother with installing it.
|
|
|
|
|
|
|
|
- name: "configure sshd"
|
|
|
|
ansible.builtin.template:
|
2023-07-08 09:45:59 +02:00
|
|
|
src: "./99-local.conf"
|
2022-12-20 19:47:11 +01:00
|
|
|
dest: "/etc/ssh/sshd_config.d/99-local.conf"
|
|
|
|
mode: 0600
|
|
|
|
register: system_base_sshd_conf
|
|
|
|
|
2023-02-11 12:37:16 +01:00
|
|
|
- name: "enable ssh"
|
2022-12-20 19:47:11 +01:00
|
|
|
ansible.builtin.systemd:
|
2023-02-11 12:37:16 +01:00
|
|
|
name: "ssh"
|
2022-12-20 19:47:11 +01:00
|
|
|
enabled: true
|
|
|
|
|
2023-02-11 12:37:16 +01:00
|
|
|
- name: "start ssh"
|
2022-12-20 19:47:11 +01:00
|
|
|
ansible.builtin.systemd:
|
2023-02-11 12:37:16 +01:00
|
|
|
name: "ssh"
|
2022-12-20 19:47:11 +01:00
|
|
|
state: "started"
|
|
|
|
register: system_base_sshd_start
|
|
|
|
|
2023-02-11 12:37:16 +01:00
|
|
|
- name: "restart ssh"
|
2022-12-20 19:47:11 +01:00
|
|
|
ansible.builtin.systemd:
|
2023-02-11 12:37:16 +01:00
|
|
|
name: "ssh"
|
2022-12-20 19:47:11 +01:00
|
|
|
state: "restarted"
|
|
|
|
when:
|
|
|
|
system_base_sshd_conf.changed and
|
|
|
|
not system_base_sshd_start.changed
|