From ff966788725e12b1680c1a42a37b76f79a95f77b Mon Sep 17 00:00:00 2001 From: Alessandro Fael Garcia Date: Wed, 31 Jan 2018 14:12:25 -0800 Subject: [PATCH] Setup CentOS/RHEL repositories correctly Fixes #1 --- tasks/opensource/setup-redhat.yml | 32 +++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/tasks/opensource/setup-redhat.yml b/tasks/opensource/setup-redhat.yml index 4694063..295a6da 100644 --- a/tasks/opensource/setup-redhat.yml +++ b/tasks/opensource/setup-redhat.yml @@ -2,23 +2,35 @@ - name: "(Install: CentOS/RedHat) Add Mainline NGINX Repository" yum_repository: name: nginx - baseurl: https://nginx.org/packages/mainline/{{ item }}/{{ ansible_distribution_major_version|int }}/$basearch/ + baseurl: https://nginx.org/packages/mainline/rhel/{{ ansible_distribution_major_version|int }}/$basearch/ description: NGINX Repository enabled: yes gpgcheck: yes - with_items: - - centos - - rhel - when: branch == "mainline" + when: branch == "mainline" and ansible_distribution == "RedHat" + +- name: "(Install: CentOS/RedHat) Add Mainline NGINX Repository" + yum_repository: + name: nginx + baseurl: https://nginx.org/packages/mainline/centos/{{ ansible_distribution_major_version|int }}/$basearch/ + description: NGINX Repository + enabled: yes + gpgcheck: yes + when: branch == "mainline" and ansible_distribution == "CentOS" - name: "(Install: CentOS/RedHat) Add Stable NGINX Repository" yum_repository: name: nginx - baseurl: https://nginx.org/packages/{{ item }}/{{ ansible_distribution_major_version|int }}/$basearch/ + baseurl: https://nginx.org/packages/rhel/{{ ansible_distribution_major_version|int }}/$basearch/ description: NGINX Repository enabled: yes gpgcheck: yes - with_items: - - centos - - rhel - when: branch == "stable" + when: branch == "stable" and ansible_distribution == "RedHat" + +- name: "(Install: CentOS/RedHat) Add Stable NGINX Repository" + yum_repository: + name: nginx + baseurl: https://nginx.org/packages/centos/{{ ansible_distribution_major_version|int }}/$basearch/ + description: NGINX Repository + enabled: yes + gpgcheck: yes + when: branch == "stable" and ansible_distribution == "CentOS"