]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
Move the creation of epel.repo to the common role.
authorAndrew Schoen <aschoen@redhat.com>
Tue, 21 Apr 2015 16:29:24 +0000 (11:29 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Tue, 21 Apr 2015 20:32:14 +0000 (15:32 -0500)
This also makes the change to use epel packages not built by us.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
roles/common/tasks/epel.yml [new file with mode: 0644]
roles/common/tasks/main.yml
roles/common/templates/epel.repo [new file with mode: 0644]
roles/testnode/vars/centos_6.yml
roles/testnode/vars/centos_7.yml
roles/testnode/vars/redhat_6.yml
roles/testnode/vars/redhat_7.yml

diff --git a/roles/common/tasks/epel.yml b/roles/common/tasks/epel.yml
new file mode 100644 (file)
index 0000000..80e671c
--- /dev/null
@@ -0,0 +1,13 @@
+---
+- name: Create /etc/yum.repos.d/epel.repo.
+  template:
+    src: epel.repo
+    dest: /etc/yum.repos.d/epel.repo
+    owner: root
+    group: root
+    mode: 0644
+  register: epel_repo
+
+- name: Clean yum cache
+  shell: yum clean all
+  when: epel_repo is defined and epel_repo|changed
index 10f7541540526f1f11433df2dbaca9bfc81b61b6..e706ceb1e377d6470d64abe8364c51f2106ecce1 100644 (file)
 - include: kerberos.yml
   tags:
     - kerberos
+
+# create and manage epel.repo
+- include: epel.yml
+  when:
+    ansible_distribution == "CentOS" or
+    ansible_distribution == 'RedHat'
+  tags:
+    - epel
+    - repos
diff --git a/roles/common/templates/epel.repo b/roles/common/templates/epel.repo
new file mode 100644 (file)
index 0000000..485a486
--- /dev/null
@@ -0,0 +1,8 @@
+#
+# {{ ansible_managed }}
+#
+[epel]
+name="Extra Packages for Enterprise Linux"
+baseurl="{{ epel_mirror_baseurl }}/{{ ansible_distribution_major_version }}/$basearch"
+enabled=1
+gpgcheck=0
index 12249ba172cd5e8a00d83de5dd6fc228460d0cc2..5f744c14403a185ae31c9e0c2bff183072dc67a0 100644 (file)
@@ -2,11 +2,6 @@
 # vars specific to centos 6.x
 
 yum_repos:
-  epel:
-    name: Extra Packages for Enterprise Linux 6 - $basearch 
-    baseurl: "http://{{ mirror_host }}/epel6/"
-    enabled: 1
-    gpgcheck: 0
   centos6-qemu-ceph:
     name: Cent OS 6 Local Qemu Repo
     baseurl: http://ceph.com/packages/ceph-extras/rpm/centos6/x86_64/
index 8e345ed35981606df768b42f40df43e3c4e4a2e5..aade7098f5a7c966dc34cc50b9ee418d2f251c80 100644 (file)
@@ -2,11 +2,6 @@
 # vars specific to centos 7.x
 
 yum_repos:
-  epel:
-    name: "Extra Packages for Enterprise Linux 7 - $basearch"
-    baseurl: "http://{{ mirror_host }}/epel7/"
-    enabled: 1
-    gpgcheck: 0
   centos7-fcgi-ceph:
     name: CentOS 7 Local fastcgi Repo
     baseurl: http://gitbuilder.ceph.com/mod_fastcgi-rpm-centos7-x86_64-basic/ref/master/
index a1e9a8da322a693dec3ed8d9a86ad27a659bd4c9..f93990197953c17c17974d6e74fb2f8e5d6a8d73 100644 (file)
@@ -2,11 +2,6 @@
 # vars specific to rhel 6.x
 
 common_yum_repos:
-  epel:
-    name: "Extra Packages for Enterprise Linux 6 - $basearch"
-    baseurl: "http://{{ mirror_host }}/epel6/"
-    enabled: 1
-    gpgcheck: 0
   centos6-qemu-ceph:
     name: "Cent OS 6 Local Qemu Repo"
     baseurl: http://ceph.com/packages/ceph-extras/rpm/rhel6/x86_64/
index a47e0b7eaabf57bbf11e5edf8d52bdd6dcc237a8..0974c3e31bd99c965c33d5e950576790eb3907da 100644 (file)
@@ -2,11 +2,6 @@
 # vars specific to any rhel 7.x version
 
 common_yum_repos:
-  epel:
-    name: "Extra Packages for Enterprise Linux 7 - $basearch"
-    baseurl: "http://{{ mirror_host }}/epel7/"
-    enabled: 1
-    gpgcheck: 0
   rhel-7-fcgi-ceph:
     name: "RHEL 7 Local fastcgi Repo"
     baseurl: http://gitbuilder.ceph.com/mod_fastcgi-rpm-rhel7-x86_64-basic/ref/master/