--- - name: Install required dependency python3-libsemanage become: true dnf: name: python3-libsemanage state: present when: (ansible_distribution_major_version is version('31', '>=')) - name: Install required dependency libsemanage-python become: true dnf: name: libsemanage-python state: present when: (ansible_distribution_major_version is version('30', '<='))