diff --git a/roles/common/handlers/main.yml b/roles/common/handlers/main.yml index 7ef5c6a..c9b14fa 100644 --- a/roles/common/handlers/main.yml +++ b/roles/common/handlers/main.yml @@ -8,10 +8,10 @@ service: name=iptables-persistent state=restarted - name: reload sshd - service: name={{ sshd_service_name }} state=reloaded + systemd: name={{ sshd_service_name }} state=reloaded - name: reload sysctl command: sysctl -p /etc/sysctl.conf - name: restart firewalld - service: name=firewalld state=restarted + systemd: name=firewalld state=restarted diff --git a/roles/common/tasks/ntp.yml b/roles/common/tasks/ntp.yml index fa14dd3..edf90ea 100644 --- a/roles/common/tasks/ntp.yml +++ b/roles/common/tasks/ntp.yml @@ -8,9 +8,9 @@ command: /usr/bin/timedatectl set-timezone {{ timezone }} tags: timezone -- name: Enable systemd's NTP client +- name: Start and enable systemd's NTP client when: ansible_service_mgr == 'systemd' - service: name=systemd-timesyncd enabled=yes + systemd: name=systemd-timesyncd state=started enabled=yes - name: Uninstall ntp on modern Ubuntu/Debian apt: name=ntp state=absent update_cache=yes