Commit b598acb4 authored by Alain Takoudjou's avatar Alain Takoudjou

playbook: Enable ntp synchronisation

/reviewed-on !76
parent d8cb31f9
......@@ -10,6 +10,20 @@
service: name=ntp state=started enabled=yes
when: ansible_os_family == "Debian"
- name: check that system has timedatectl
shell: timedatectl --version >/dev/null 2>&1
register: timedatectl_exist
ignore_errors: yes
- name: Run timedatectl status
shell: timedatectl status | egrep -i "ntp\s*enabled"
register: timedatectl_result
when: timedatectl_exist.rc == 0
- name: enable synchronisation
shell: timedatectl set-ntp true
when: timedatectl_exist.rc == 0 and not "yes" in timedatectl_result.stdout
- name: ensure ntp is runing (RedHat)
service: name=ntpd state=started enabled=yes
when: ansible_os_family == "RedHat"
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