--- - hosts: all become: true vars: sudoers: ansible tasks: - name: Place repo-file nausch.org for CentOS 8 right in place copy: src: /home/django/ansible/files/CentOS8/nausch.org.repo dest: /etc/yum.repos.d/ when: - ansible_facts['distribution'] == "CentOS" - ansible_facts['distribution_major_version'] == "8" - name: Place repo-file nausch.org for CentOS 7 right in place copy: src: files/CentOS7/nausch.org.repo dest: /etc/yum.repos.d/ when: - ansible_facts['distribution'] == "CentOS" - ansible_facts['distribution_major_version'] == "7" ...