diff --git a/tests/tests_ntp_provider3.yml b/tests/tests_ntp_provider3.yml index 1dcc272e..eaacfb28 100644 --- a/tests/tests_ntp_provider3.yml +++ b/tests/tests_ntp_provider3.yml @@ -43,5 +43,10 @@ timeout: 2 - name: Check ntpd service - shell: ntpq -c rv | grep 'associd=0' + shell: | + set -eu + if set -o | grep -q pipefail; then + set -o pipefail # no pipefail on debian, some ubuntu + fi + ntpq -c rv | grep 'associd=0' changed_when: false diff --git a/tests/tests_ntp_provider5.yml b/tests/tests_ntp_provider5.yml index 5d817b2f..9f141cf7 100644 --- a/tests/tests_ntp_provider5.yml +++ b/tests/tests_ntp_provider5.yml @@ -38,5 +38,10 @@ timeout: 2 - name: Check ntpd service - shell: ntpq -c rv | grep 'associd=0' + shell: | + set -eu + if set -o | grep -q pipefail; then + set -o pipefail # no pipefail on debian, some ubuntu + fi + ntpq -c rv | grep 'associd=0' changed_when: false diff --git a/tests/tests_ntp_provider6.yml b/tests/tests_ntp_provider6.yml index 5fde67da..77afcd88 100644 --- a/tests/tests_ntp_provider6.yml +++ b/tests/tests_ntp_provider6.yml @@ -70,7 +70,12 @@ changed_when: false - name: Check ntpd service - shell: ntpq -c rv | grep 'associd=0' + shell: | + set -eu + if set -o | grep -q pipefail; then + set -o pipefail # no pipefail on debian, some ubuntu + fi + ntpq -c rv | grep 'associd=0' when: not is_ntp_default changed_when: false @@ -88,7 +93,12 @@ timeout: 2 - name: Check ntpd service - shell: ntpq -c rv | grep 'associd=0' + shell: | + set -eu + if set -o | grep -q pipefail; then + set -o pipefail # no pipefail on debian, some ubuntu + fi + ntpq -c rv | grep 'associd=0' when: is_ntp_default | bool changed_when: false