29 lines
632 B
YAML
29 lines
632 B
YAML
|
---
|
||
|
# SSH must be installed so we don't bother with installing it.
|
||
|
|
||
|
- name: "configure sshd"
|
||
|
ansible.builtin.template:
|
||
|
src: "./99-local.conf.j2"
|
||
|
dest: "/etc/ssh/sshd_config.d/99-local.conf"
|
||
|
mode: 0600
|
||
|
register: system_base_sshd_conf
|
||
|
|
||
|
- name: "enable sshd"
|
||
|
ansible.builtin.systemd:
|
||
|
name: "sshd"
|
||
|
enabled: true
|
||
|
|
||
|
- name: "start sshd"
|
||
|
ansible.builtin.systemd:
|
||
|
name: "sshd"
|
||
|
state: "started"
|
||
|
register: system_base_sshd_start
|
||
|
|
||
|
- name: "restart sshd"
|
||
|
ansible.builtin.systemd:
|
||
|
name: "sshd"
|
||
|
state: "restarted"
|
||
|
when:
|
||
|
system_base_sshd_conf.changed and
|
||
|
not system_base_sshd_start.changed
|