1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-15 04:32:11 +00:00
iiab/roles/sshd/tasks/main.yml
2018-09-19 20:47:46 -04:00

21 lines
466 B
YAML

- name: Disable root login with password
lineinfile:
dest: /etc/ssh/sshd_config
regexp: '^PermitRootLogin'
line: 'PermitRootLogin without-password'
state: present
#TODO: use handler to reload ssh
- name: Enable & start sshd
service:
name: "{{ sshd_service }}"
enabled: yes
state: started
when: sshd_enabled
- name: Disable sshd
service:
name: "{{ sshd_service }}"
enabled: no
state: stopped
when: not sshd_enabled