From b38aeb28de251f5e10ba00d85a4306d903693b0b Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Mon, 12 Oct 2015 14:12:06 +0000 Subject: [PATCH] Put rhel* only on RHEL and epel* on el* --- tasks/yumrepos.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/tasks/yumrepos.yml b/tasks/yumrepos.yml index 3911978daa..06895f11c8 100644 --- a/tasks/yumrepos.yml +++ b/tasks/yumrepos.yml @@ -1,21 +1,15 @@ --- -- 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' or ansible_distribution == 'CentOS') and ansible_distribution_major_version|int == 6 +- name: put rhel repos on rhel systems + action: copy src="{{ files }}/common/rhel{{ ansible_distribution_major_version }}.repo" dest="/etc/yum.repos.d/rhel{{ ansible_distribution_major_version }}.repo" + when: ansible_distribution == 'RedHat' 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' or ansible_distribution == 'CentOS') and ansible_distribution_major_version|int == 7 +- name: put epel repos on el systems + action: copy src="{{ files }}/common/epel{{ ansible_distribution_major_version }}.repo" dest="/etc/yum.repos.d/epel{{ ansible_distribution_major_version }}.repo" + when: (ansible_distribution == 'RedHat' or ansible_distribution == 'CentOS') tags: - config - packages