mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
modern Ansible syntax in roles/sshd
This commit is contained in:
parent
84eea97af9
commit
ea6382c221
1 changed files with 13 additions and 10 deletions
|
@ -1,18 +1,21 @@
|
|||
- name: Disable root login with password
|
||||
lineinfile: dest=/etc/ssh/sshd_config
|
||||
regexp='^PermitRootLogin'
|
||||
line='PermitRootLogin without-password'
|
||||
state=present
|
||||
lineinfile:
|
||||
dest: /etc/ssh/sshd_config
|
||||
regexp: '^PermitRootLogin'
|
||||
line: 'PermitRootLogin without-password'
|
||||
state: present
|
||||
#TODO: use handler to reload ssh
|
||||
|
||||
- name: Enable sshd
|
||||
service: name={{ sshd_service }}
|
||||
enabled=yes
|
||||
state=started
|
||||
service:
|
||||
name: "{{ sshd_service }}"
|
||||
enabled: yes
|
||||
state: started
|
||||
when: sshd_enabled
|
||||
|
||||
- name: Disable sshd
|
||||
service: name={{ sshd_service }}
|
||||
enabled=no
|
||||
state=stopped
|
||||
service:
|
||||
name: "{{ sshd_service }}"
|
||||
enabled: no
|
||||
state: stopped
|
||||
when: not sshd_enabled
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue