diff --git a/ibm/mas_devops/roles/suite_app_config/defaults/main.yml b/ibm/mas_devops/roles/suite_app_config/defaults/main.yml index 5788ba2af1..6c68fc3d3b 100644 --- a/ibm/mas_devops/roles/suite_app_config/defaults/main.yml +++ b/ibm/mas_devops/roles/suite_app_config/defaults/main.yml @@ -30,6 +30,9 @@ cos_instance_name: "{{ lookup('env', 'COS_INSTANCE_NAME') }}" cos_bucket_name: "{{ lookup('env', 'COS_BUCKET_NAME') }}" ibmcloud_resourcegroup: "{{ lookup('env', 'IBMCLOUD_RESOURCEGROUP') }}" +# Only used by Manage (Upgrade type) +mas_appws_upgrade_type: "{{ lookup('env', 'MAS_APPWS_UPGRADE_TYPE') | default('regularUpgrade', true) }}" + # 4. Cloud Pak for Data integration (Predict, HP Utils) # ----------------------------------------------------------------------------- diff --git a/ibm/mas_devops/roles/suite_app_config/vars/defaultspecs/manage.yml b/ibm/mas_devops/roles/suite_app_config/vars/defaultspecs/manage.yml index 40c8d76d03..bd34942bd9 100644 --- a/ibm/mas_devops/roles/suite_app_config/vars/defaultspecs/manage.yml +++ b/ibm/mas_devops/roles/suite_app_config/vars/defaultspecs/manage.yml @@ -23,4 +23,6 @@ mas_appws_spec: tableSpace: "{{ mas_app_settings_tablespace }}" indexSpace: "{{ mas_app_settings_indexspace }}" bypassUpgradeVersionCheck: false + upgrade: + upgradeType: "{{ mas_appws_upgrade_type }}" customizationList: "{{ mas_app_settings_customization_list if (mas_app_settings_customization_archive_url is defined and mas_app_settings_customization_archive_url | length > 0) else [] }}" diff --git a/ibm/mas_devops/roles/suite_app_install/README.md b/ibm/mas_devops/roles/suite_app_install/README.md index 15ec9f7712..f3bce63bf8 100644 --- a/ibm/mas_devops/roles/suite_app_install/README.md +++ b/ibm/mas_devops/roles/suite_app_install/README.md @@ -208,6 +208,14 @@ The content of the configuration file should be the yaml block that you wish to For full documentation of the supported options refer to the [Customizing Pod Templates](https://www.ibm.com/docs/en/mas-cd/continuous-delivery?topic=configuring-customizing-workloads) in the product documentation. +### mas_appws_upgrade_type +Provide the upgrade type to be used by Manage Workspace. The value of the environment variable should be either `regularUpgrade` or `onlineUpgrade`. + +- Optional +- Environment Variable: `MAS_APPWS_UPGRADE_TYPE` +- Default: `regularUpgrade` + +For full documentation of the upgrade types refer to the [Manage Upgrade information](https://www.ibm.com/docs/en/masv-and-l/cd?topic=database-reducing-system-downtime) in the product documentation. Role Variables - Monitor Configuration ------------------------------------------------------------------------------- diff --git a/ibm/mas_devops/roles/suite_app_upgrade/tasks/upgrade.yml b/ibm/mas_devops/roles/suite_app_upgrade/tasks/upgrade.yml index 3e83f6e4c9..933fa9f385 100644 --- a/ibm/mas_devops/roles/suite_app_upgrade/tasks/upgrade.yml +++ b/ibm/mas_devops/roles/suite_app_upgrade/tasks/upgrade.yml @@ -83,6 +83,42 @@ # 5. Check that the Application Workspaces meet the required state # ----------------------------------------------------------------------------- +- name: 'Check if workspace CR reconciled version is updated to target version (manage only)' + kubernetes.core.k8s_info: + api_version: "{{ app_info[mas_app_id].api_version }}" + kind: "{{ app_info[mas_app_id].ws_kind }}" + namespace: "{{ mas_app_namespace }}" + label_selectors: + - mas.ibm.com/instanceId={{ mas_instance_id }} + - mas.ibm.com/applicationId={{ mas_app_id }} + retries: 30 # about 60 minutes + delay: 120 # 2 minutes + until: + - app_ws_cr_version.resources is defined + - app_ws_cr_version.resources[0].status.versions.reconciled == updated_opcon_version + when: + - mas_app_id == "manage" + register: app_ws_cr_version + +- name: 'Check that all workspace CRs are healthy (manage only)' + kubernetes.core.k8s_info: + api_version: "{{ app_info[mas_app_id].api_version }}" + kind: "{{ app_info[mas_app_id].ws_kind }}" + namespace: "{{ mas_app_namespace }}" + label_selectors: + - mas.ibm.com/instanceId={{ mas_instance_id }} + - mas.ibm.com/applicationId={{ mas_app_id }} + retries: 60 # about 120 minutes + delay: 120 # 2 minutes + until: + - manage_ws_cr_lookup.resources is defined + - manage_ws_cr_lookup.resources | json_query('[*].status.conditions[?type==`Ready`][].reason') | select ('in', ['Ready']) | list | length == app_ws_cr_lookup.resources | length + - manage_ws_cr_lookup.resources | json_query('[*].status.conditions[?type==`Running`][].reason') | select ('in', ['Successful']) | list | length == app_ws_cr_lookup.resources | length + - manage_ws_cr_lookup.resources | json_query('[*].status.conditions[?type==`DeploymentCR`][].reason') | select ('in', ['Successful']) | list | length == app_ws_cr_lookup.resources | length + when: + - mas_app_id == "manage" + register: manage_ws_cr_lookup + - name: 'Check that all workspace CRs are healthy' kubernetes.core.k8s_info: api_version: "{{ app_info[mas_app_id].api_version }}" @@ -96,6 +132,8 @@ until: - app_ws_cr_lookup.resources is defined - app_ws_cr_lookup.resources | json_query('[*].status.conditions[?type==`Ready`][].reason') | select ('in', ['Ready', 'WorkspaceReady']) | list | length == app_ws_cr_lookup.resources | length + when: + - mas_app_id != "manage" register: app_ws_cr_lookup - name: "{{ mas_app_id }} : Debug Workspaces"