main.yml 434 B

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