# SPDX-License-Identifier: MIT
---
- name: Check if primary pmlogger is running
  shell: |
    set -eu
    if set -o | grep -q pipefail; then
      set -o pipefail  # no pipefail on debian, some ubuntu
    fi
    pmprobe -I pmcd.pmlogger.pmcd_host | grep '"primary"'
  when: (ansible_facts['distribution'] in ['RedHat', 'CentOS'] and
         ansible_facts['distribution_major_version'] | int > 6) or
         ansible_facts['distribution'] not in ['Fedora', 'RedHat', 'CentOS']
  changed_when: false
