|
@@ -64,7 +64,6 @@
|
|
|
when:
|
|
|
- openshift_cloudprovider_kind is defined
|
|
|
- openshift_cloudprovider_kind == 'vsphere'
|
|
|
- - openshift_version | version_compare('3.9', '>=')
|
|
|
|
|
|
# The main master upgrade play. Should handle all changes to the system in one pass, with
|
|
|
# support for optional hooks to be defined.
|
|
@@ -92,7 +91,6 @@
|
|
|
when:
|
|
|
- openshift_cloudprovider_kind is defined
|
|
|
- openshift_cloudprovider_kind == 'vsphere'
|
|
|
- - openshift_version | version_compare('3.9', '>=')
|
|
|
|
|
|
# Run the upgrade hook prior to restarting services/system if defined:
|
|
|
- debug: msg="Running master upgrade hook {{ openshift_master_upgrade_hook }}"
|
|
@@ -119,20 +117,6 @@
|
|
|
- include_tasks: "{{ openshift_master_upgrade_post_hook }}"
|
|
|
when: openshift_master_upgrade_post_hook is defined
|
|
|
|
|
|
- - name: Post master upgrade - Upgrade clusterpolicies storage
|
|
|
- command: >
|
|
|
- {{ openshift_client_binary }} adm --config={{ openshift.common.config_base }}/master/admin.kubeconfig
|
|
|
- migrate storage --include=clusterpolicies --confirm
|
|
|
- register: l_pb_upgrade_control_plane_post_upgrade_storage
|
|
|
- when:
|
|
|
- - openshift_upgrade_post_storage_migration_enabled | default(true) | bool
|
|
|
- - openshift_version is version_compare('3.7','<')
|
|
|
- failed_when:
|
|
|
- - l_pb_upgrade_control_plane_post_upgrade_storage.rc != 0
|
|
|
- - openshift_upgrade_post_storage_migration_fatal | default(false) | bool
|
|
|
- run_once: true
|
|
|
- delegate_to: "{{ groups.oo_first_master.0 }}"
|
|
|
-
|
|
|
- set_fact:
|
|
|
master_update_complete: True
|
|
|
|
|
@@ -165,87 +149,6 @@
|
|
|
vars:
|
|
|
__master_shared_resource_viewer_file: "shared_resource_viewer_role.yaml"
|
|
|
tasks:
|
|
|
- - name: Reconcile Cluster Roles
|
|
|
- command: >
|
|
|
- {{ openshift_client_binary }} adm --config={{ openshift.common.config_base }}/master/admin.kubeconfig
|
|
|
- policy reconcile-cluster-roles --additive-only=true --confirm -o name
|
|
|
- register: reconcile_cluster_role_result
|
|
|
- when: openshift_version is version_compare('3.7','<')
|
|
|
- changed_when:
|
|
|
- - reconcile_cluster_role_result.stdout != ''
|
|
|
- - reconcile_cluster_role_result.rc == 0
|
|
|
- run_once: true
|
|
|
-
|
|
|
- - name: Reconcile Cluster Role Bindings
|
|
|
- command: >
|
|
|
- {{ openshift_client_binary }} adm --config={{ openshift.common.config_base }}/master/admin.kubeconfig
|
|
|
- policy reconcile-cluster-role-bindings
|
|
|
- --exclude-groups=system:authenticated
|
|
|
- --exclude-groups=system:authenticated:oauth
|
|
|
- --exclude-groups=system:unauthenticated
|
|
|
- --exclude-users=system:anonymous
|
|
|
- --additive-only=true --confirm -o name
|
|
|
- when: openshift_version is version_compare('3.7','<')
|
|
|
- register: reconcile_bindings_result
|
|
|
- changed_when:
|
|
|
- - reconcile_bindings_result.stdout != ''
|
|
|
- - reconcile_bindings_result.rc == 0
|
|
|
- run_once: true
|
|
|
-
|
|
|
- - name: Reconcile Jenkins Pipeline Role Bindings
|
|
|
- command: >
|
|
|
- {{ openshift_client_binary }} adm --config={{ openshift.common.config_base }}/master/admin.kubeconfig policy reconcile-cluster-role-bindings system:build-strategy-jenkinspipeline --confirm -o name
|
|
|
- run_once: true
|
|
|
- register: reconcile_jenkins_role_binding_result
|
|
|
- changed_when:
|
|
|
- - reconcile_jenkins_role_binding_result.stdout != ''
|
|
|
- - reconcile_jenkins_role_binding_result.rc == 0
|
|
|
- when:
|
|
|
- - openshift_version is version_compare('3.7','<')
|
|
|
-
|
|
|
- - when: openshift_upgrade_target is version_compare('3.7','<')
|
|
|
- block:
|
|
|
- - name: Retrieve shared-resource-viewer
|
|
|
- oc_obj:
|
|
|
- state: list
|
|
|
- kind: role
|
|
|
- name: "shared-resource-viewer"
|
|
|
- namespace: "openshift"
|
|
|
- register: objout
|
|
|
-
|
|
|
- - name: Determine if shared-resource-viewer is protected
|
|
|
- set_fact:
|
|
|
- __shared_resource_viewer_protected: true
|
|
|
- when:
|
|
|
- - "'results' in objout"
|
|
|
- - "'results' in objout['results']"
|
|
|
- - "'annotations' in objout['results']['results'][0]['metadata']"
|
|
|
- - "'openshift.io/reconcile-protect' in objout['results']['results'][0]['metadata']['annotations']"
|
|
|
- - "objout['results']['results'][0]['metadata']['annotations']['openshift.io/reconcile-protect'] == 'true'"
|
|
|
- - copy:
|
|
|
- src: "{{ item }}"
|
|
|
- dest: "/tmp/{{ item }}"
|
|
|
- with_items:
|
|
|
- - "{{ __master_shared_resource_viewer_file }}"
|
|
|
- when: __shared_resource_viewer_protected is not defined
|
|
|
-
|
|
|
- - name: Fixup shared-resource-viewer role
|
|
|
- oc_obj:
|
|
|
- state: present
|
|
|
- kind: role
|
|
|
- name: "shared-resource-viewer"
|
|
|
- namespace: "openshift"
|
|
|
- files:
|
|
|
- - "/tmp/{{ __master_shared_resource_viewer_file }}"
|
|
|
- delete_after: true
|
|
|
- when: __shared_resource_viewer_protected is not defined
|
|
|
- register: result
|
|
|
- retries: 3
|
|
|
- delay: 5
|
|
|
- until: result.rc == 0
|
|
|
- ignore_errors: true
|
|
|
-
|
|
|
-
|
|
|
- name: Reconcile Security Context Constraints
|
|
|
command: >
|
|
|
{{ openshift_client_binary }} adm policy --config={{ openshift.common.config_base }}/master/admin.kubeconfig reconcile-sccs --confirm --additive-only=true -o name
|