diff --git a/tasks/add_repo_RedHat.yml b/tasks/add_repo_RedHat.yml index ae6ff51..9a0d37d 100644 --- a/tasks/add_repo_RedHat.yml +++ b/tasks/add_repo_RedHat.yml @@ -8,4 +8,12 @@ # mode: 0644 - name: Registering Ansible repository - copy: src=yum-ansible.repo dest=/etc/yum.repos.d/ansible.repo owner=root group=root mode=0644 + copy: + src: yum-ansible.repo + dest: /etc/yum.repos.d/ansible.repo + owner: root + group: root + mode: 0644 + when: + - "ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat'" + - "ansible_distribution_major_version < '8'"