blob: 14a7cb56efa590e824e70ba3f608c296b981f65d (
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
85
86
87
|
---
- name: Copy openshift examples
copy:
src: "examples/{{ content_version }}/"
dest: "{{ examples_base }}/"
- name: Modify registry paths if registry_url is not registry.access.redhat.com
shell: >
find {{ examples_base }} -type f | xargs -n 1 sed -i 's|registry.access.redhat.com|{{ registry_host | quote }}|g'
when: registry_host != '' and openshift_examples_modify_imagestreams | default(False) | bool
# RHEL and Centos image streams are mutually exclusive
- name: Import RHEL streams
command: >
{{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ rhel_image_streams }}
when: openshift_examples_load_rhel | bool
register: oex_import_rhel_streams
failed_when: "'already exists' not in oex_import_rhel_streams.stderr and oex_import_rhel_streams.rc != 0"
changed_when: false
- name: Import Centos Image streams
command: >
{{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ centos_image_streams }}
when: openshift_examples_load_centos | bool
register: oex_import_centos_streams
failed_when: "'already exists' not in oex_import_centos_streams.stderr and oex_import_centos_streams.rc != 0"
changed_when: false
- name: Import db templates
command: >
{{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ db_templates_base }}
when: openshift_examples_load_db_templates | bool
register: oex_import_db_templates
failed_when: "'already exists' not in oex_import_db_templates.stderr and oex_import_db_templates.rc != 0"
changed_when: false
- name: Import quickstart-templates
command: >
{{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ quickstarts_base }}
when: openshift_examples_load_quickstarts | bool
register: oex_import_quickstarts
failed_when: "'already exists' not in oex_import_quickstarts.stderr and oex_import_quickstarts.rc != 0"
changed_when: false
- name: Import origin infrastructure-templates
command: >
{{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ infrastructure_origin_base }}
when: openshift_examples_load_centos | bool
register: oex_import_infrastructure
failed_when: "'already exists' not in oex_import_infrastructure.stderr and oex_import_infrastructure.rc != 0"
changed_when: false
- name: Import enterprise infrastructure-templates
command: >
{{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ infrastructure_enterprise_base }}
when: openshift_examples_load_rhel | bool
register: oex_import_infrastructure
failed_when: "'already exists' not in oex_import_infrastructure.stderr and oex_import_infrastructure.rc != 0"
changed_when: false
- name: Remove old xPaas template files
file:
path: "{{ item }}"
state: absent
with_items:
- "{{ xpaas_templates }}/sso70-basic.json"
- name: Remove old xPaas templates from openshift namespace
command: oc delete -n openshift {{ item }}
with_items:
- sso70-basic
- name: Import xPaas image streams
command: >
{{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ xpaas_image_streams }}
when: openshift_examples_load_xpaas | bool
register: oex_import_xpaas_streams
failed_when: "'already exists' not in oex_import_xpaas_streams.stderr and oex_import_xpaas_streams.rc != 0"
changed_when: false
- name: Import xPaas templates
command: >
{{ openshift.common.client_binary }} {{ openshift_examples_import_command }} -n openshift -f {{ xpaas_templates_base }}
when: openshift_examples_load_xpaas | bool
register: oex_import_xpaas_templates
failed_when: "'already exists' not in oex_import_xpaas_templates.stderr and oex_import_xpaas_templates.rc != 0"
changed_when: false
|