--- # There is no good solution as far as I know, but a question on stackoverflow: # https://stackoverflow.com/questions/42651026/ansible-dnf-module-enable-fedora-copr-repository - name: activate copr become: yes command: dnf copr enable -y carlwgeorge/ripgrep changed_when: false when: (ansible_distribution == "Fedora" and ansible_distribution_major_version >= 24) tags: ripgrep - name: install ripgrep become: yes dnf: name: ripgrep state: present when: (ansible_distribution == "Fedora" and ansible_distribution_major_version >= 24) tags: ripgrep # This needs to be done: TODO CentOS 7 # - name: activate copr # become: yes # yum_repository: # name: copr # https://copr.fedorainfracloud.org/coprs/carlwgeorge/ripgrep/repo/epel-7/carlwgeorge-ripgrep-epel-7.repo # state: present # enabled: yes # yum-config-manager --add-repo=https://copr.fedorainfracloud.org/coprs/carlwgeorge/ripgrep/repo/epel-7/carlwgeorge-ripgrep-epel-7.repo # when: (ansible_distribution == "CentOS" and ansible_distribution_major_version == 7) # tags: ripgrep # # - name: install ripgrep # become: yes # yum: # name: ripgrep # state: present # when: (ansible_distribution == "CentOS" and ansible_distribution_major_version == 7) # tags: ripgrep