As those task are only reading the installed packages and their output
is required in later tasks it is safe to run them also in check mode.
command: rpm -q chrony
register: ntp_pkg_query
ignore_errors: true
+ always_run: true
changed_when: false
command: dpkg -s ntp
register: ntp_pkg_query
ignore_errors: true
+ always_run: true
changed_when: false
when: ansible_os_family == 'Debian'
command: rpm -q ntp
register: ntp_pkg_query
ignore_errors: true
+ always_run: true
changed_when: false
when: ansible_os_family == 'RedHat'