summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--filter_plugins/oo_filters.py2
-rw-r--r--playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml8
-rw-r--r--roles/openshift_examples/README.md2
-rw-r--r--roles/openshift_examples/tasks/main.yml43
-rw-r--r--roles/openshift_hosted/tasks/router/router.yml4
-rw-r--r--roles/openshift_version/tasks/main.yml7
6 files changed, 57 insertions, 9 deletions
diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py
index d706d0304..ec00a1646 100644
--- a/filter_plugins/oo_filters.py
+++ b/filter_plugins/oo_filters.py
@@ -660,7 +660,7 @@ class FilterModule(object):
if kind == 'nfs':
host = params['host']
if host == None:
- if len(groups['oo_nfs_to_config']) > 0:
+ if 'oo_nfs_to_config' in groups and len(groups['oo_nfs_to_config']) > 0:
host = groups['oo_nfs_to_config'][0]
else:
raise errors.AnsibleFilterError("|failed no storage host detected")
diff --git a/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml b/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml
index 7a8dfdf91..a27b62971 100644
--- a/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml
+++ b/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml
@@ -87,7 +87,7 @@
# Request openshift_release 3.2 and let the openshift_version role handle converting this
# to a more specific version, respecting openshift_image_tag and openshift_pkg_version if
# defined, and overriding the normal behavior of protecting the installed version
- openshift_release: "3.2"
+ openshift_release: "{{ '1.2' if deployment_type == 'origin' else '3.2' }}"
openshift_protect_installed_version: False
# Docker role (a dependency) should be told not to do anything to installed version
# of docker, we handle this separately during upgrade. (the inventory may have a
@@ -176,8 +176,12 @@
- name: Verify OpenShift 3.2 RPMs are available for upgrade
fail:
msg: "OpenShift {{ avail_openshift_version.stdout }} is available, but 3.2 or greater is required"
- when: not openshift.common.is_containerized | bool and not avail_openshift_version | skipped and avail_openshift_version.stdout | default('0.0', True) | version_compare('3.2', '<')
+ when: deployment_type != 'origin' and not openshift.common.is_containerized | bool and not avail_openshift_version | skipped and avail_openshift_version.stdout | default('0.0', True) | version_compare(openshift_release, '<')
+ - name: Verify Origin 1.2 RPMs are available for upgrade
+ fail:
+ msg: "OpenShift {{ avail_openshift_version.stdout }} is available, but 1.2 or greater is required"
+ when: deployment_type == 'origin' and not openshift.common.is_containerized | bool and not avail_openshift_version | skipped and avail_openshift_version.stdout | default('0.0', True) | version_compare(openshift_release, '<')
# TODO: Are these two grep checks necessary anymore?
# Note: the version number is hardcoded here in hopes of catching potential
diff --git a/roles/openshift_examples/README.md b/roles/openshift_examples/README.md
index 6ddbe7017..8cc479c73 100644
--- a/roles/openshift_examples/README.md
+++ b/roles/openshift_examples/README.md
@@ -25,7 +25,7 @@ Role Variables
|-------------------------------------|-----------------------------------------------------|------------------------------------------|
| openshift_examples_load_centos | true when openshift_deployment_typenot 'enterprise' | Load centos image streams |
| openshift_examples_load_rhel | true if openshift_deployment_type is 'enterprise' | Load rhel image streams |
-| openshift_examples_load_db_templates| true | Loads databcase templates |
+| openshift_examples_load_db_templates| true | Loads database templates |
| openshift_examples_load_quickstarts | true | Loads quickstarts ie: nodejs, rails, etc |
| openshift_examples_load_xpaas | false | Loads xpass streams and templates |
diff --git a/roles/openshift_examples/tasks/main.yml b/roles/openshift_examples/tasks/main.yml
index 7ea39f51e..8d2248578 100644
--- a/roles/openshift_examples/tasks/main.yml
+++ b/roles/openshift_examples/tasks/main.yml
@@ -1,9 +1,46 @@
---
-- name: Copy openshift examples
- copy:
- src: "examples/{{ content_version }}/"
+######################################################################
+# Copying Examples
+#
+# We used to use the copy module to transfer the openshift examples to
+# the remote. Then it started taking more than a minute to transfer
+# the files. As noted in the module:
+#
+# "The 'copy' module recursively copy facility does not scale to
+# lots (>hundreds) of files."
+#
+# The `synchronize` module is suggested as an alternative, we can't
+# use it either due to changes introduced in Ansible 2.x.
+- name: Create local temp dir for OpenShift examples copy
+ local_action: command mktemp -d /tmp/openshift-ansible-XXXXXXX
+ become: False
+ register: copy_examples_mktemp
+ run_once: True
+
+- name: Create tar of OpenShift examples
+ local_action: command tar -C "{{ role_path }}/files/examples/{{ content_version }}/" -cvf "{{ copy_examples_mktemp.stdout }}/openshift-examples.tar" .
+ become: False
+ register: copy_examples_tar
+
+- name: Create the remote OpenShift examples directory
+ file:
+ dest: "{{ examples_base }}"
+ state: directory
+ mode: 0755
+
+- name: Unarchive the OpenShift examples on the remote
+ unarchive:
+ src: "{{ copy_examples_mktemp.stdout }}/openshift-examples.tar"
dest: "{{ examples_base }}/"
+- name: Cleanup the OpenShift Examples temp dir
+ become: False
+ local_action: file dest="{{ copy_examples_mktemp.stdout }}" state=absent
+
+# Done copying examples
+######################################################################
+# Begin image streams
+
- 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'
diff --git a/roles/openshift_hosted/tasks/router/router.yml b/roles/openshift_hosted/tasks/router/router.yml
index 95f0617dc..dfea8ca4b 100644
--- a/roles/openshift_hosted/tasks/router/router.yml
+++ b/roles/openshift_hosted/tasks/router/router.yml
@@ -32,7 +32,7 @@
content: "{{ openshift.hosted.router.certificate.contents }}"
dest: "{{ openshift_master_config_dir }}/openshift-router.pem"
mode: 0600
- when: openshift.hosted.router.certificate | default(none) is not none
+ when: "'certificate' in openshift.hosted.router and 'contents' in openshift.hosted.router.certificate"
- name: Retrieve list of openshift nodes matching router selector
command: >
@@ -53,7 +53,7 @@
{% if replicas > 1 -%}
--replicas={{ replicas }}
{% endif -%}
- {% if openshift.hosted.router.certificate | default(none) is not none -%}
+ {% if 'certificate' in openshift.hosted.router and 'contents' in openshift.hosted.router.certificate -%}
--default-cert={{ openshift_master_config_dir }}/openshift-router.pem
{% endif -%}
--namespace={{ openshift.hosted.router.namespace | default('default') }}
diff --git a/roles/openshift_version/tasks/main.yml b/roles/openshift_version/tasks/main.yml
index 0a134f557..d07fd5fbc 100644
--- a/roles/openshift_version/tasks/main.yml
+++ b/roles/openshift_version/tasks/main.yml
@@ -78,3 +78,10 @@
- fail:
msg: "Detected openshift version {{ openshift_version }} does not match requested openshift_release {{ openshift_release }}. You may need to adjust your yum repositories or specify an exact openshift_pkg_version."
when: not is_containerized | bool and openshift_release is defined and not openshift_version.startswith(openshift_release) | bool
+
+# The end result of these three variables is quite important so make sure they are displayed and logged:
+- debug: var=openshift_release
+
+- debug: var=openshift_image_tag
+
+- debug: var=openshift_pkg_version