---
- name: put rhel repos on rhel6 systems
  action: copy src="{{ files }}/common/{{ item }}" dest="/etc/yum.repos.d/{{ item }}"
  with_items:
  - epel6.repo
  - rhel6.repo
  when: ansible_distribution == 'RedHat' and ansible_distribution_major_version == '6'
  tags:
  - config
  - packages
  - yumrepos

- name: put rhel repos on rhel7 systems
  action: copy src="{{ files }}/common/{{ item }}" dest="/etc/yum.repos.d/{{ item }}"
  with_items:
  - epel7.repo
  - rhel7.repo
  when: ansible_distribution == 'RedHat' and ansible_distribution_major_version == '7'
  tags:
  - config
  - packages
  - yumrepos

- name: put fedora repos on x86 systems
  action: copy src="{{ files }}/common/{{ item }}" dest="/etc/yum.repos.d/{{ item }}"
  with_items:
  - fedora.repo
  - fedora-updates.repo
  - fedora-updates-testing.repo
  when: ansible_distribution == 'Fedora' and (ansible_architecture == 'x86_64' or ansible_architecture == 'i386')
  tags:
  - config
  - packages
  - yumrepos

- name: put fedora repos on arm systems
  action: copy src="{{ files }}/common/{{ item }}-arm" dest="/etc/yum.repos.d/{{ item }}"
  with_items:
  - fedora.repo
  - fedora-updates.repo
  - fedora-updates-testing.repo
  when: ansible_distribution == 'Fedora' and ansible_architecture == 'armv7l' and not inventory_hostname.startswith('arm03')
  tags:
  - config
  - packages
  - yumrepos

- name: add infrastructure repo
  action: copy src="{{ files }}/common/{{ item }}" dest="/etc/yum.repos.d/{{ item }}"
  with_items:
  - infrastructure.repo
  - infrastructure-testing.repo
  tags:
  - config
  - packages
  - yumrepos
