]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
Adds epel-testing to the list of epel repos we install in common.
authorAndrew Schoen <aschoen@redhat.com>
Wed, 22 Apr 2015 15:23:27 +0000 (10:23 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Wed, 22 Apr 2015 15:54:40 +0000 (10:54 -0500)
This also restructures the task a bit so that we can easily add new
repos as vars. The epel-testing repo is disabled by defaulti and will
be activated by the roles that need it.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
roles/common/defaults/main.yml
roles/common/tasks/epel.yml
roles/common/templates/epel.repo [deleted file]
roles/common/templates/yum_repo.j2 [new file with mode: 0644]

index b3dc61aff3ad370094ecff31feaab8e03f00934b..e5cb894766a2f0fa2bedf7280058a32f388b78ef 100644 (file)
@@ -1,4 +1,17 @@
+---
 # Repos to enable in Red Hat Subscription Manager
 rhsm_repos: []
 
 kerberos_realm: EXAMPLE.COM
+
+epel_repos:
+  epel:
+    name: "Extra Packages for Enterprise Linux"
+    baseurl: "{{ epel_mirror_baseurl }}/{{ ansible_distribution_major_version }}/$basearch"
+    enabled: 1
+    gpgcheck: 0
+  epel-testing:
+    name: "Extra Packages for Enterprise Linux - Testing"
+    baseurl: "{{ epel_mirror_baseurl }}/testing/{{ ansible_distribution_major_version }}/$basearch"
+    enabled: 0
+    gpgcheck: 0
index 80e671c3a8f953758e3fe76377256117446891f3..4b73fcd5228e5f0e90212bc5344804715f20fcfc 100644 (file)
@@ -1,12 +1,13 @@
 ---
-- name: Create /etc/yum.repos.d/epel.repo.
+- name: Configure epel repos in /etc/yum.repos.d/
   template:
-    src: epel.repo
-    dest: /etc/yum.repos.d/epel.repo
+    src: yum_repo.j2
+    dest: /etc/yum.repos.d/{{ item.key }}.repo
     owner: root
     group: root
     mode: 0644
   register: epel_repo
+  with_dict: epel_repos
 
 - name: Clean yum cache
   shell: yum clean all
diff --git a/roles/common/templates/epel.repo b/roles/common/templates/epel.repo
deleted file mode 100644 (file)
index 485a486..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#
-# {{ ansible_managed }}
-#
-[epel]
-name="Extra Packages for Enterprise Linux"
-baseurl="{{ epel_mirror_baseurl }}/{{ ansible_distribution_major_version }}/$basearch"
-enabled=1
-gpgcheck=0
diff --git a/roles/common/templates/yum_repo.j2 b/roles/common/templates/yum_repo.j2
new file mode 100644 (file)
index 0000000..d9e2bd0
--- /dev/null
@@ -0,0 +1,8 @@
+#
+# {{ ansible_managed }}
+#
+
+[{{ item.key }}]
+{% for k, v in item.value.iteritems() | sort -%}
+  {{ k }}={{ v }}
+{% endfor %}