From 53a41ba5bab2b029cdab13057e69506f7e9fd1a2 Mon Sep 17 00:00:00 2001
From: handreas <andreas.hamacher@monash.edu>
Date: Thu, 13 Feb 2020 22:10:13 +0000
Subject: [PATCH] changing .repo files to templates step2

---
 roles/config_repos/tasks/main.yml                  | 4 ++--
 roles/config_repos/templates/epel.repo             | 2 +-
 roles/config_repos/templates/monashhpc_base.repo   | 8 ++++----
 roles/config_repos/templates/monashhpc_others.repo | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/roles/config_repos/tasks/main.yml b/roles/config_repos/tasks/main.yml
index 70a40ab9..684c327a 100644
--- a/roles/config_repos/tasks/main.yml
+++ b/roles/config_repos/tasks/main.yml
@@ -33,7 +33,7 @@
 #  when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == "7"
 
 - name: add our repos
-  copy: src={{ item }} dest=/etc/yum.repos.d/{{ item }}
+  template: src={{ item }}.j2 dest=/etc/yum.repos.d/{{ item }}
   become: true
   when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == "7"
   with_items:
@@ -55,7 +55,7 @@
   with_items: "{{ repolist.stdout_lines|difference(yumenablerepo) }}"
   become: true
   become_user: root
-  ignore_errors: true
+  ignore_errors: false
 
 
 #- name: Enable epel
diff --git a/roles/config_repos/templates/epel.repo b/roles/config_repos/templates/epel.repo
index 053ed43c..4b1017bf 100644
--- a/roles/config_repos/templates/epel.repo
+++ b/roles/config_repos/templates/epel.repo
@@ -2,7 +2,7 @@
 
 [epel]
 name=Extra Packages for Enterprise Linux 7 - $basearch
-baseurl=https://consistency0/epel/$releasever/$basearch/
+baseurl=https://{{ reposervername }}/epel/$releasever/$basearch/
 enabled=0
 gpgcheck=0
 sslverify=false
diff --git a/roles/config_repos/templates/monashhpc_base.repo b/roles/config_repos/templates/monashhpc_base.repo
index dfbb0a77..0f0cd119 100644
--- a/roles/config_repos/templates/monashhpc_base.repo
+++ b/roles/config_repos/templates/monashhpc_base.repo
@@ -2,24 +2,24 @@
 
 [monashhpc_base]
 name=MonashHPC base repository mirrored to control the update process
-baseurl=https://consistency0/centos/$releasever/os/$basearch/
+baseurl=https://{{ reposervername }}/centos/$releasever/os/$basearch/
 enabled=1
 sslverify=false
 
 [monashhpc_updates]
 name=MonashHPC base repository mirrored to control the update process
-baseurl=https://consistency0/centos/$releasever/updates/$basearch/
+baseurl=https://{{ reposervername }}/centos/$releasever/updates/$basearch/
 enabled=1
 sslverify=false
 
 [monashhpc_extras]
 name=MonashHPC base repository mirrored to control the update process
-baseurl=https://consistency0/centos/$releasever/extras/$basearch/
+baseurl=https://{{ reposervername }}/centos/$releasever/extras/$basearch/
 enabled=1
 sslverify=false
 
 [monashhpc_centosplus]
 name=MonashHPC base repository mirrored to control the update process
-baseurl=https://consistency0/centos/$releasever/centosplus/$basearch/
+baseurl=https://{{ reposervername }}/centos/$releasever/centosplus/$basearch/
 enabled=1
 sslverify=false
diff --git a/roles/config_repos/templates/monashhpc_others.repo b/roles/config_repos/templates/monashhpc_others.repo
index e78702bf..bd0b0627 100644
--- a/roles/config_repos/templates/monashhpc_others.repo
+++ b/roles/config_repos/templates/monashhpc_others.repo
@@ -2,7 +2,7 @@
 
 [monashhpc_otherstuff]
 name=MonashHPC base repository mirrored to control the update process
-baseurl=https://consistency0/centos/hpcsystems/$releasever/$basearch/
+baseurl=https://{{ reposervername }}/centos/hpcsystems/$releasever/$basearch/
 enabled=1
 sslverify=false
 gpgcheck=0
-- 
GitLab