main.yml 458 B

123456789101112131415161718192021222324252627
  1. ---
  2. - name: restart ntpd
  3. service:
  4. name=ntpd
  5. state=restarted
  6. enabled=yes
  7. - name: restart chrony
  8. service:
  9. name=chronyd
  10. state=restarted
  11. enabled=yes
  12. - name: sync ntp clocks
  13. command: ntpdc -np
  14. register: ntp_clock
  15. until: ntp_clock.stdout.find('*') > -1
  16. retries: 10
  17. delay: 60
  18. - name: sync chrony sources
  19. command: chronyc sources
  20. register: chrony_src
  21. until: chrony_src.stdout.find('^*') > -1
  22. retries: 6
  23. delay: 10