Update playbooks/ntpdig-check.yml
This commit is contained in:
@@ -24,10 +24,10 @@
|
||||
changed_when: false
|
||||
failed_when: ntpdig_output.rc != 0
|
||||
|
||||
- name: Parse offset from ntpdig output
|
||||
- name: Parse correct offset and error from ntpdig output
|
||||
set_fact:
|
||||
ntpdig_offset: "{{ ntpdig_output.stdout | regex_search('([+-]?\\d+\\.\\d+)', '\\1') | default('N/A') }}"
|
||||
ntpdig_error: "{{ ntpdig_output.stdout | regex_search('\\+/-\\s+(\\d+\\.\\d+)', '\\1') | default('N/A') }}"
|
||||
ntpdig_offset: "{{ ntpdig_output.stdout | regex_search('[+-][0-9]+\\.[0-9]+(?=\\s+\\+/-)', '\\0') | default('N/A') }}"
|
||||
ntpdig_error: "{{ ntpdig_output.stdout | regex_search('\\+/-\\s+([0-9]+\\.[0-9]+)', '\\1') | default('N/A') }}"
|
||||
|
||||
- name: Show parsed ntpdig result
|
||||
debug:
|
||||
|
||||
Reference in New Issue
Block a user