# SPDX-License-Identifier: MIT
---
- name: Check if primary pmie is running
  shell: |
    set -euo pipefail
    pmprobe -I pmcd.pmie.pmcd_host | grep '"primary"'
  changed_when: false
  when:
    - (ansible_distribution in ['RedHat', 'CentOS'] and
       ansible_distribution_major_version | int > 6) or
       ansible_distribution not in ['Fedora', 'RedHat', 'CentOS']
    - __metrics_is_booted | bool
