ansible-edda/playbooks/roles/system/base/tasks/include/sshd.yml

28 lines
661 B
YAML
Raw Normal View History

# SSH must be installed so we don't bother with installing it.
- name: "sshd : configure sshd"
ansible.builtin.template:
src: "./sshd/99-local.conf.j2"
dest: "/etc/ssh/sshd_config.d/99-local.conf"
mode: 0600
2022-12-08 23:19:54 +01:00
register: system_base_sshd_conf
- name: "sshd : enable sshd"
ansible.builtin.systemd:
name: "sshd"
enabled: true
- name: "sshd : start sshd"
ansible.builtin.systemd:
name: "sshd"
state: "started"
2022-12-08 23:19:54 +01:00
register: system_base_sshd_start
- name: "sshd : restart sshd"
ansible.builtin.systemd:
name: "sshd"
state: "restarted"
when:
2022-12-08 23:19:54 +01:00
system_base_sshd_conf.changed and
not system_base_sshd_start.changed