summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2016-06-17 13:42:10 -0400
committerGitHub <noreply@github.com>2016-06-17 13:42:10 -0400
commit4597740a002236c70d45829bc22e0d0d126a0cbd (patch)
tree8e424b41781f1bd041e0816c05b78c55abadfb24
parent5c095116ff23ee1ccbe6ba0407cff0fb05d9980d (diff)
parented28e9a5929aaa305d5d9db38da96887184b3338 (diff)
downloadopenshift-4597740a002236c70d45829bc22e0d0d126a0cbd.tar.gz
openshift-4597740a002236c70d45829bc22e0d0d126a0cbd.tar.bz2
openshift-4597740a002236c70d45829bc22e0d0d126a0cbd.tar.xz
openshift-4597740a002236c70d45829bc22e0d0d126a0cbd.zip
Merge pull request #1925 from sdodson/disconnected-image-streams
If registry_url != registry.access.redhat.com then modify image streams
-rw-r--r--playbooks/common/openshift-cluster/additional_config.yml1
-rw-r--r--playbooks/common/openshift-cluster/upgrades/v3_0_minor/upgrade.yml1
-rw-r--r--playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml1
-rw-r--r--playbooks/common/openshift-cluster/upgrades/v3_1_minor/post.yml1
-rw-r--r--playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/post.yml1
-rw-r--r--roles/openshift_examples/defaults/main.yml2
-rw-r--r--roles/openshift_examples/tasks/main.yml5
7 files changed, 12 insertions, 0 deletions
diff --git a/playbooks/common/openshift-cluster/additional_config.yml b/playbooks/common/openshift-cluster/additional_config.yml
index ebddc7841..a34322754 100644
--- a/playbooks/common/openshift-cluster/additional_config.yml
+++ b/playbooks/common/openshift-cluster/additional_config.yml
@@ -17,6 +17,7 @@
- role: openshift_master_cluster
when: openshift_master_ha | bool and openshift.master.cluster_method == "pacemaker"
- role: openshift_examples
+ registry_url: "{{ openshift.master.registry_url }}"
when: openshift.common.install_examples | bool
- role: openshift_cluster_metrics
when: openshift.common.use_cluster_metrics | bool
diff --git a/playbooks/common/openshift-cluster/upgrades/v3_0_minor/upgrade.yml b/playbooks/common/openshift-cluster/upgrades/v3_0_minor/upgrade.yml
index 5b2bf9f93..e31e7f8a3 100644
--- a/playbooks/common/openshift-cluster/upgrades/v3_0_minor/upgrade.yml
+++ b/playbooks/common/openshift-cluster/upgrades/v3_0_minor/upgrade.yml
@@ -109,5 +109,6 @@
vars:
openshift_examples_import_command: "update"
openshift_deployment_type: "{{ deployment_type }}"
+ registry_url: "{{ openshift.master.registry_url }}"
roles:
- openshift_examples
diff --git a/playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml b/playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml
index 3a4c58e43..c3c1240d8 100644
--- a/playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml
+++ b/playbooks/common/openshift-cluster/upgrades/v3_0_to_v3_1/upgrade.yml
@@ -569,6 +569,7 @@
# Update the existing templates
- role: openshift_examples
openshift_examples_import_command: replace
+ registry_url: "{{ openshift.master.registry_url }}"
pre_tasks:
- name: Collect all routers
command: >
diff --git a/playbooks/common/openshift-cluster/upgrades/v3_1_minor/post.yml b/playbooks/common/openshift-cluster/upgrades/v3_1_minor/post.yml
index 196393b2a..f030eed18 100644
--- a/playbooks/common/openshift-cluster/upgrades/v3_1_minor/post.yml
+++ b/playbooks/common/openshift-cluster/upgrades/v3_1_minor/post.yml
@@ -19,6 +19,7 @@
# Update the existing templates
- role: openshift_examples
openshift_examples_import_command: replace
+ registry_url: "{{ openshift.master.registry_url }}"
pre_tasks:
- name: Collect all routers
command: >
diff --git a/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/post.yml b/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/post.yml
index 31e76805c..c16965a35 100644
--- a/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/post.yml
+++ b/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/post.yml
@@ -19,6 +19,7 @@
- openshift_examples
# Update the existing templates
- role: openshift_examples
+ registry_url: "{{ openshift.master.registry_url }}"
openshift_examples_import_command: replace
pre_tasks:
- name: Collect all routers
diff --git a/roles/openshift_examples/defaults/main.yml b/roles/openshift_examples/defaults/main.yml
index 976ff7702..d88014bea 100644
--- a/roles/openshift_examples/defaults/main.yml
+++ b/roles/openshift_examples/defaults/main.yml
@@ -20,3 +20,5 @@ infrastructure_origin_base: "{{ examples_base }}/infrastructure-templates/origin
infrastructure_enterprise_base: "{{ examples_base }}/infrastructure-templates/enterprise"
openshift_examples_import_command: "create"
+registry_url: ""
+registry_host: "{{ registry_url.split('/')[0] if '.' in registry_url.split('/')[0] else '' }}" \ No newline at end of file
diff --git a/roles/openshift_examples/tasks/main.yml b/roles/openshift_examples/tasks/main.yml
index a5731be09..fb10188f2 100644
--- a/roles/openshift_examples/tasks/main.yml
+++ b/roles/openshift_examples/tasks/main.yml
@@ -4,6 +4,11 @@
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 != ''
+
# RHEL and Centos image streams are mutually exclusive
- name: Import RHEL streams
command: >