1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 03:32:12 +00:00
iiab/roles/sshd/tasks/enable-or-disable.yml

16 lines
400 B
YAML
Raw Normal View History

- name: Enable & (Re)Start ssh daemon ({{ sshd_service }}) if sshd_enabled
systemd:
daemon_reload: yes
name: "{{ sshd_service }}"
enabled: yes
state: restarted
when: sshd_enabled
- name: Disable & Stop ssh daemon ({{ sshd_service }}) if not sshd_enabled
systemd:
daemon_reload: yes
name: "{{ sshd_service }}"
enabled: no
state: stopped
when: not sshd_enabled