- hosts: all tasks: - name: Install python3-dnf or python2-dnf if distro flavor is RH-like and version is 7 dnf: name: - python3-dnf - python2-dnf state: present when: - ansible_facts.distribution_file_variety == "RedHat" - ansible_facts['distribution_major_version'] == '7' ignore_errors: yes roles: - { role: DataDog.datadog, become: yes } vars: datadog_api_key: "{{ dd_api_key }}" datadog_site: ddog-gov.com