---

# NTP Status Tests

- name: Gather ntp status
  eos_command:
    commands: "show ntp status"
  register: ntp_status
  tags:
    - ntp

- name: Validate ntp status
  delegate_to: localhost
  assert:
    that:
      - ntp_status.stdout[0] | regex_search('synchronised to NTP server')
    fail_msg: "Not synchronised to NTP server"
    quiet: true
  ignore_errors: "{{ eos_validate_state_validation_mode_loose }}"
  register: ntp_status_results
  tags:
    - ntp
