summaryrefslogtreecommitdiffstats
path: root/roles/repos/tasks/main.yaml
diff options
context:
space:
mode:
authorThomas Wiest <twiest@users.noreply.github.com>2015-02-23 13:26:09 -0500
committerThomas Wiest <twiest@users.noreply.github.com>2015-02-23 13:26:09 -0500
commit89528214cdaf8cad7321079f573d844db7004b71 (patch)
tree8725c92f07518fcacc4f1a0ab60e19070c9f9484 /roles/repos/tasks/main.yaml
parent8e299557333c7d35368d12a030344e676bbed831 (diff)
parent12ec90897f890e1f5ee417d9f6f56baa359f0313 (diff)
downloadopenshift-89528214cdaf8cad7321079f573d844db7004b71.tar.gz
openshift-89528214cdaf8cad7321079f573d844db7004b71.tar.bz2
openshift-89528214cdaf8cad7321079f573d844db7004b71.tar.xz
openshift-89528214cdaf8cad7321079f573d844db7004b71.zip
Merge pull request #76 from detiber/repoChanges
Repo role refactor to add enterprise support
Diffstat (limited to 'roles/repos/tasks/main.yaml')
-rw-r--r--roles/repos/tasks/main.yaml47
1 files changed, 36 insertions, 11 deletions
diff --git a/roles/repos/tasks/main.yaml b/roles/repos/tasks/main.yaml
index a6a80581e..43786da41 100644
--- a/roles/repos/tasks/main.yaml
+++ b/roles/repos/tasks/main.yaml
@@ -1,16 +1,41 @@
---
-# The following role lays down the correct repository and gpg key for yum
-- name: Ensure rhel 7 libra candidate exists in yum.repos.d
- copy: src=rhel-7-libra-candidate.repo dest=/etc/yum.repos.d/rhel-7-libra-candidate.repo
+# TODO: Add flag for enabling EPEL repo, default to false
-- name: Ensure rhel 7 extras exists in yum.repos.d
- copy: src=oso-rhui-rhel-7-extras.repo dest=/etc/yum.repos.d/oso-rhui-rhel-7-extras.repo
+- assert:
+ that: openshift_deployment_type in known_openshift_deployment_types
-- name: Ensure the kubernetes repo is available
- copy: src=epel7-kubernetes.repo dest=/etc/yum.repos.d/epel7-kubernetes.repo
+# TODO: remove this when origin support actually works
+- fail: msg="OpenShift Origin support is not currently enabled"
+ when: openshift_deployment_type == 'origin'
-- name: Ensure the origin repo is available
- copy: src=epel7-openshift.repo dest=/etc/yum.repos.d/epel7-openshift.repo
+- name: Create any additional repos that are defined
+ template:
+ src: yum_repo.j2
+ dest: /etc/yum.repos.d/openshift_additional.repo
+ when: openshift_additional_repos | length > 0
-- name: Ensure the rhel repo is available
- copy: src=oso-rhui-rhel-7-server.repo dest=/etc/yum.repos.d/oso-rhui-rhel-7-server.repo
+- name: Remove the additional repos if no longer defined
+ file:
+ dest: /etc/yum.repos.d/openshift_additional.repo
+ state: absent
+ when: openshift_additional_repos | length == 0
+
+- name: Remove any yum repo files for other deployment types
+ file:
+ path: "/etc/yum.repos.d/{{ item | basename }}"
+ state: absent
+ with_fileglob:
+ - '*/*'
+ when: not (item | search("/files/" + openshift_deployment_type + "/")) and (item | search(".repo$"))
+
+- name: Configure gpg keys if needed
+ copy: src={{ item }} dest=/etc/pki/rpm-gpg/
+ with_fileglob:
+ - "{{ openshift_deployment_type }}/*"
+ when: item | basename | match("RPM-GPG-KEY-")
+
+- name: Configure yum repositories
+ copy: src={{ item }} dest=/etc/yum.repos.d/
+ with_fileglob:
+ - "{{ openshift_deployment_type }}/*"
+ when: item | basename | search(".*\.repo$")