Commit 8f8c258a authored by Rafael Monnerat's avatar Rafael Monnerat

playbook: Fix restart of ssh services on multiple distros

parent f06e6c63
...@@ -2,3 +2,8 @@ ...@@ -2,3 +2,8 @@
- name: restart ssh - name: restart ssh
service: name=ssh state=restarted service: name=ssh state=restarted
when: ansible_os_family == "Debian"
- name: restart sshd
service: name=sshd state=restarted
when: ansible_os_family == "RedHat"
...@@ -25,8 +25,10 @@ ...@@ -25,8 +25,10 @@
lineinfile: dest=/etc/ssh/sshd_config regexp="^PermitRootLogin (?!no)" line="PermitRootLogin no" lineinfile: dest=/etc/ssh/sshd_config regexp="^PermitRootLogin (?!no)" line="PermitRootLogin no"
notify: notify:
- restart ssh - restart ssh
- restart sshd
- name: update /etc/ssh/sshd_config - name: update /etc/ssh/sshd_config
lineinfile: dest=/etc/ssh/sshd_config line="PermitRootLogin no" lineinfile: dest=/etc/ssh/sshd_config line="PermitRootLogin no"
notify: notify:
- restart ssh - restart ssh
- restart sshd
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment