blob: 32d66132e3f9e15ded61e3aa425aea08ad7682d7 (
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
---
# TODO: Add flag for enabling EPEL repo, default to false
# TODO: Add subscription-management config, with parameters
# for username, password, poolid(name), and official repos to
# enable/disable. Might need to make a module that extends the
# subscription management module to take a poolid and enable/disable the
# proper repos correctly.
- assert:
that: openshift_deployment_type in known_openshift_deployment_types
when: not openshift.common.is_containerized | bool
- name: Ensure libselinux-python is installed
action: "{{ ansible_pkg_mgr }} name=libselinux-python state=present"
when: not openshift.common.is_containerized | bool
- 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 and not openshift.common.is_containerized | bool
notify: refresh cache
- 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 and not openshift.common.is_containerized | bool
notify: refresh cache
- name: Remove any yum repo files for other deployment types RHEL/CentOS
file:
path: "/etc/yum.repos.d/{{ item | basename }}"
state: absent
with_fileglob:
- '*/repos/*'
when: not openshift.common.is_containerized | bool
and not (item | search("/files/" ~ openshift_deployment_type ~ "/repos"))
and (ansible_os_family == "RedHat" and ansible_distribution != "Fedora")
notify: refresh cache
- name: Remove any yum repo files for other deployment types Fedora
file:
path: "/etc/yum.repos.d/{{ item | basename }}"
state: absent
with_fileglob:
- '*/repos/*'
when: not openshift.common.is_containerized | bool
and not (item | search("/files/fedora-" ~ openshift_deployment_type ~ "/repos"))
and (ansible_distribution == "Fedora")
notify: refresh cache
- name: Configure gpg keys if needed
copy:
src: "{{ item }}"
dest: /etc/pki/rpm-gpg/
with_fileglob:
- "{{ openshift_deployment_type }}/gpg_keys/*"
notify: refresh cache
when: not openshift.common.is_containerized | bool
- name: Configure yum repositories RHEL/CentOS
copy:
src: "{{ item }}"
dest: /etc/yum.repos.d/
with_fileglob:
- "{{ openshift_deployment_type }}/repos/*"
notify: refresh cache
when: (ansible_os_family == "RedHat" and ansible_distribution != "Fedora")
and not openshift.common.is_containerized | bool
- name: Configure yum repositories Fedora
copy:
src: "{{ item }}"
dest: /etc/yum.repos.d/
with_fileglob:
- "fedora-{{ openshift_deployment_type }}/repos/*"
notify: refresh cache
when: (ansible_distribution == "Fedora") and not openshift.common.is_containerized | bool
- name: Configure the CentOS PaaS SIG repos if needed
include: centos_sig.yaml
when: not openshift.common.is_containerized | bool and deployment_type == 'origin' and ansible_distribution != 'Fedora'
|