diff --git a/ansible/roles/baremetal/tasks/post-install.yml b/ansible/roles/baremetal/tasks/post-install.yml index fec915dfe8..75c6de5382 100644 --- a/ansible/roles/baremetal/tasks/post-install.yml +++ b/ansible/roles/baremetal/tasks/post-install.yml @@ -61,6 +61,40 @@ enabled: yes become: True +- name: Stop time service + service: + name: ntp + state: stopped + become: True + when: ansible_os_family == "Debian" + +- name: Stop time service + service: + name: ntpd + state: stopped + become: True + when: ansible_os_family == "RedHat" + +- name: Synchronizing time one-time + command: ntpd -gq + become: True + +- name: Start time sync service + service: + name: ntp + state: started + enabled: yes + become: True + when: ansible_os_family == "Debian" + +- name: Start time sync service + service: + name: ntpd + state: started + enabled: yes + become: True + when: ansible_os_family == "RedHat" + - name: Reboot command: reboot -f become: True