blob: f972c0fd9d100d7b07b61cad6a252f614c92c394 (
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
|
---
- name: openshift_repos detect ostree
stat:
path: /run/ostree-booted
register: ostree_booted
- when: not ostree_booted.stat.exists
block:
# TODO: This needs to be removed and placed into a role
- name: Ensure libselinux-python is installed
package: name=libselinux-python state=present
- name: Create any additional repos that are defined
yum_repository:
description: "{{ item.description | default(item.name | default(item.id)) }}"
name: "{{ item.name | default(item.id) }}"
baseurl: "{{ item.baseurl }}"
gpgkey: "{{ item.gpgkey | default(omit)}}"
gpgcheck: "{{ item.gpgcheck | default(1) }}"
sslverify: "{{ item.sslverify | default(1) }}"
sslclientkey: "{{ item.sslclientkey | default(omit) }}"
sslclientcert: "{{ item.sslclientcert | default(omit) }}"
file: "{{ item.name }}"
enabled: "{{ item.enabled | default('no')}}"
with_items: "{{ openshift_additional_repos }}"
when: openshift_additional_repos | length > 0
notify: refresh cache
# Singleton block
- when: r_openshift_repos_has_run is not defined
block:
# Note: OpenShift repositories under CentOS may be shipped through the
# "centos-release-openshift-origin" package which configures the repository.
# This task matches the file names provided by the package so that they are
# not installed twice in different files and remains idempotent.
- name: Configure origin repositories and gpg keys if needed
copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
with_items:
- src: origin/gpg_keys/openshift-ansible-CentOS-SIG-PaaS
dest: /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-PaaS
- src: origin/repos/openshift-ansible-centos-paas-sig.repo
dest: /etc/yum.repos.d/CentOS-OpenShift-Origin.repo
notify: refresh cache
when:
- ansible_os_family == "RedHat"
- ansible_distribution != "Fedora"
- openshift_deployment_type == 'origin'
- openshift_enable_origin_repo | default(true) | bool
- name: Enable centos-openshift-origin-testing repository
command: yum-config-manager --enable centos-openshift-origin-testing
when: openshift_repos_enable_testing | bool
- name: Ensure clean repo cache in the event repos have been changed manually
debug:
msg: "First run of openshift_repos"
changed_when: true
notify: refresh cache
- name: Record that openshift_repos already ran
set_fact:
r_openshift_repos_has_run: True
# Force running ALL handlers now, because we expect repo cache to be cleared
# if changes have been made.
- meta: flush_handlers
|