summaryrefslogtreecommitdiffstats
path: root/roles/openshift_repos/tasks/main.yaml
blob: 6219c490622faacc0c5afe90a2c85ad244ea9b0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
# TODO: Add flag for enabling EPEL repo, default to false

- assert:
    that: openshift_deployment_type in known_openshift_deployment_types

# TODO: remove this when origin support actually works
- fail: msg="OpenShift Origin support is not currently enabled"
  when: openshift_deployment_type == 'origin'

- name: Ensure libselinux-python is installed
  yum:
    pkg: libselinux-python
    state: present

- 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: 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$")