|
@@ -3,7 +3,7 @@
|
|
|
# Evaluate host groups and gather facts
|
|
|
###############################################################################
|
|
|
|
|
|
-- include: ../../initialize_facts.yml
|
|
|
+- include: ../initialize_facts.yml
|
|
|
|
|
|
- name: Update repos and initialize facts on all hosts
|
|
|
hosts: oo_masters_to_config:oo_nodes_to_config:oo_etcd_to_config:oo_lb_to_config
|
|
@@ -39,7 +39,6 @@
|
|
|
- name: Verify upgrade can proceed on first master
|
|
|
hosts: oo_first_master
|
|
|
vars:
|
|
|
- target_version: "{{ '1.2' if deployment_type == 'origin' else '3.2' }}"
|
|
|
g_pacemaker_upgrade_url_segment: "{{ 'org/latest' if deployment_type =='origin' else '.com/enterprise/3.1' }}"
|
|
|
gather_facts: no
|
|
|
tasks:
|
|
@@ -63,14 +62,14 @@
|
|
|
- fail:
|
|
|
msg: >
|
|
|
openshift_pkg_version is {{ openshift_pkg_version }} which is not a
|
|
|
- valid version for a {{ target_version }} upgrade
|
|
|
- when: openshift_pkg_version is defined and openshift_pkg_version.split('-',1).1 | version_compare(target_version ,'<')
|
|
|
+ valid version for a {{ openshift_upgrade_target }} upgrade
|
|
|
+ when: openshift_pkg_version is defined and openshift_pkg_version.split('-',1).1 | version_compare(openshift_upgrade_target ,'<')
|
|
|
|
|
|
- fail:
|
|
|
msg: >
|
|
|
openshift_image_tag is {{ openshift_image_tag }} which is not a
|
|
|
- valid version for a {{ target_version }} upgrade
|
|
|
- when: openshift_image_tag is defined and openshift_image_tag.split('v',1).1 | version_compare(target_version ,'<')
|
|
|
+ valid version for a {{ openshift_upgrade_target }} upgrade
|
|
|
+ when: openshift_image_tag is defined and openshift_image_tag.split('v',1).1 | version_compare(openshift_upgrade_target ,'<')
|
|
|
|
|
|
- set_fact:
|
|
|
openshift_release: "{{ openshift_release[1:] }}"
|
|
@@ -79,15 +78,15 @@
|
|
|
- fail:
|
|
|
msg: >
|
|
|
openshift_release is {{ openshift_release }} which is not a
|
|
|
- valid release for a {{ target_version }} upgrade
|
|
|
- when: openshift_release is defined and not openshift_release | version_compare(target_version ,'=')
|
|
|
+ valid release for a {{ openshift_upgrade_target }} upgrade
|
|
|
+ when: openshift_release is defined and not openshift_release | version_compare(openshift_upgrade_target ,'=')
|
|
|
|
|
|
-- include: ../../../../common/openshift-cluster/initialize_openshift_version.yml
|
|
|
+- include: ../../../common/openshift-cluster/initialize_openshift_version.yml
|
|
|
vars:
|
|
|
- # Request openshift_release 3.2 and let the openshift_version role handle converting this
|
|
|
+ # Request specific openshift_release 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: "{{ '1.2' if deployment_type == 'origin' else '3.2' }}"
|
|
|
+ openshift_release: "{{ openshift_upgrade_target }}"
|
|
|
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
|
|
@@ -141,7 +140,6 @@
|
|
|
- name: Verify upgrade targets
|
|
|
hosts: oo_masters_to_config:oo_nodes_to_config
|
|
|
vars:
|
|
|
- target_version: "{{ '1.2' if deployment_type == 'origin' else '3.2' }}"
|
|
|
openshift_docker_hosted_registry_network: "{{ hostvars[groups.oo_first_master.0].openshift.common.portal_net }}"
|
|
|
pre_tasks:
|
|
|
- fail:
|
|
@@ -175,40 +173,14 @@
|
|
|
register: avail_openshift_version
|
|
|
when: not openshift.common.is_containerized | bool
|
|
|
|
|
|
- - name: Verify OpenShift 3.2 RPMs are available for upgrade
|
|
|
+ - name: Verify OpenShift RPMs are available for upgrade
|
|
|
fail:
|
|
|
- msg: "OpenShift {{ avail_openshift_version.stdout }} is available, but 3.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, '<')
|
|
|
-
|
|
|
- - 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
|
|
|
- # bugs in how g_aos_versions.curr_version is set
|
|
|
- - name: Verifying the correct version is installed for upgrade
|
|
|
- shell: grep 3.1.1.6 {{ item }}
|
|
|
- with_items:
|
|
|
- - /etc/sysconfig/openvswitch
|
|
|
- - /etc/sysconfig/{{ openshift.common.service_type }}*
|
|
|
- when: verify_upgrade_version is defined
|
|
|
-
|
|
|
- - name: Verifying the image version is used in the systemd unit
|
|
|
- shell: grep IMAGE_VERSION {{ item }}
|
|
|
- with_items:
|
|
|
- - /etc/systemd/system/openvswitch.service
|
|
|
- - /etc/systemd/system/{{ openshift.common.service_type }}*.service
|
|
|
- when: openshift.common.is_containerized | bool and verify_upgrade_version is defined
|
|
|
-
|
|
|
- - fail:
|
|
|
- msg: This upgrade playbook must be run on Origin 1.1 or later
|
|
|
- when: deployment_type == 'origin' and openshift.common.version | version_compare('1.1','<')
|
|
|
+ msg: "OpenShift {{ avail_openshift_version.stdout }} is available, but {{ openshift_upgrade_target }} 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(openshift_release, '<')
|
|
|
|
|
|
- fail:
|
|
|
- msg: This upgrade playbook must be run on OpenShift Enterprise 3.1 or later
|
|
|
- when: deployment_type == 'atomic-openshift' and openshift.common.version | version_compare('3.1','<')
|
|
|
+ msg: "This upgrade playbook must be run against OpenShift {{ openshift_upgrade_min }} or later"
|
|
|
+ when: deployment_type == 'origin' and openshift.common.version | version_compare(openshift_upgrade_min,'<')
|
|
|
|
|
|
- name: Verify docker upgrade targets
|
|
|
hosts: oo_masters_to_config:oo_nodes_to_config:oo_etcd_to_config
|