diff --git a/ibm/mas_devops/roles/convert_to_olm/README.md b/ibm/mas_devops/roles/convert_to_olm/README.md index 44a3bd888..1120ff6b7 100644 --- a/ibm/mas_devops/roles/convert_to_olm/README.md +++ b/ibm/mas_devops/roles/convert_to_olm/README.md @@ -20,7 +20,7 @@ The instance ID of Maximo Application Suite. This will be used to lookup for app - Environment Variable: `MAS_INSTANCE_ID` - Default: None -### mas_catalog_source +### mas_catalog_source Defines the catalog to be used to install MAS channel subscription. - Optional @@ -62,12 +62,6 @@ Username for entitled registry. This username will be used to create the image p - Environment Variable: `MAS_ENTITLEMENT_KEY` - Default: None -### mas_upgrade_strategy -The Upgrade strategy for MAS Operator. - -- Optional -- Environment Variable: `MAS_UPGRADE_STRATEGY` -- Default: `Manual` Example Playbook ---------------- diff --git a/ibm/mas_devops/roles/convert_to_olm/defaults/main.yml b/ibm/mas_devops/roles/convert_to_olm/defaults/main.yml index 60d285673..be0ffcb18 100644 --- a/ibm/mas_devops/roles/convert_to_olm/defaults/main.yml +++ b/ibm/mas_devops/roles/convert_to_olm/defaults/main.yml @@ -4,7 +4,6 @@ mas_instance_id: "{{ lookup('ansible.builtin.env', 'MAS_INSTANCE_ID') }}" mas_app_id: "{{ lookup('ansible.builtin.env', 'MAS_APP_ID') }}" -mas_upgrade_strategy: "{{ lookup('ansible.builtin.env', 'MAS_UPGRADE_STRATEGY') | default('Manual', true) }}" mas_catalog_source: "{{ lookup('ansible.builtin.env', 'MAS_CATALOG_SOURCE') | default('ibm-operator-catalog', true) }}" mas_app_namespace: "mas-{{ mas_instance_id }}-{{ mas_app_id }}" diff --git a/ibm/mas_devops/roles/convert_to_olm/tasks/main.yml b/ibm/mas_devops/roles/convert_to_olm/tasks/main.yml index 3bc08163c..5d7ad0a0e 100644 --- a/ibm/mas_devops/roles/convert_to_olm/tasks/main.yml +++ b/ibm/mas_devops/roles/convert_to_olm/tasks/main.yml @@ -54,7 +54,6 @@ - "MAS Instance ID ........ '{{ mas_instance_id }}'" - "MAS App ID ............. '{{ mas_app_id }}'" - "MAS App Namespace ...... '{{ mas_app_namespace }}'" - - "MAS Upgrade Strategy ... '{{ mas_upgrade_strategy }}'" # 2. Check App and Determine if OLM conversion is possible # ----------------------------------------------------------------------------- @@ -360,56 +359,7 @@ operator_group: "{{ lookup('template', 'templates/operator-group.yml.j2') }}" subscription: "{{ lookup('template', 'templates/subscription.yml.j2') }}" - # 3.5. Approve InstallPlan(s) when in Manual subscription - # ------------------------------------------------------------------------- - - name: "Lookup and Approve Subscription: {{ supported_apps[mas_app_id]['name'] }}" - when: mas_upgrade_strategy == 'Manual' - block: - - name: Lookup Operator install plan - kubernetes.core.k8s_info: - api_version: operators.coreos.com/v1alpha1 - kind: InstallPlan - namespace: "{{ mas_app_namespace }}" - label_selectors: - - "operators.coreos.com/{{ supported_apps[mas_app_id]['csv_name'] }}.{{ mas_app_namespace }}" - register: _mas_install_plan - retries: 40 - delay: 30 # 40 x 30 seconds = 20 minutes - until: _mas_install_plan.resources | length > 0 - - - name: Approve the subscription install plan - when: - - _mas_install_plan is defined - - _mas_install_plan.resources is defined - - _mas_install_plan.resources | length > 0 - - _mas_install_plan.resources[0].status is defined - - _mas_install_plan.resources[0].status.phase is defined - - _mas_install_plan.resources[0].status.phase != "Complete" - kubernetes.core.k8s: - definition: - apiVersion: operators.coreos.com/v1alpha1 - kind: InstallPlan - metadata: - name: "{{ _mas_install_plan.resources[0].metadata.name }}" - namespace: "{{ mas_app_namespace }}" - spec: - approved: true - - # 3.6. Handle IBM Common Services Install plan approvals when - # upgrade strategy is set to Manual - # ------------------------------------------------------------------------- - # ibm-common-services operators deployed by MAS will inherit the inherit - # MAS upgrade strategy when its set to Manual, we need to iterate those to - # ensure we do approve the first install plan otherwise MAS installation - # won't succeed. - - name: Handle IBM Common Services InstallPlan approvals - ansible.builtin.include_tasks: tasks/ibm-common-services.yml - when: - - mas_upgrade_strategy == 'Manual' - - mas_app_id == 'core' - loop: "{{ ibm_common_services_subscription_labels }}" - - # 3.7. Verify the (main + TM) operator pods are running and ready + # 3.5. Verify the (main + TM) operator pods are running and ready # ------------------------------------------------------------------------- - name: "Check if operator is ready: {{ supported_apps[mas_app_id]['op_name'] }}" kubernetes.core.k8s_info: diff --git a/ibm/mas_devops/roles/convert_to_olm/templates/subscription.yml.j2 b/ibm/mas_devops/roles/convert_to_olm/templates/subscription.yml.j2 index 77cbc34d7..90725cce5 100644 --- a/ibm/mas_devops/roles/convert_to_olm/templates/subscription.yml.j2 +++ b/ibm/mas_devops/roles/convert_to_olm/templates/subscription.yml.j2 @@ -6,7 +6,7 @@ metadata: namespace: "{{ mas_app_namespace }}" spec: channel: "{{ app_channel }}" - installPlanApproval: "{{ mas_upgrade_strategy }}" + installPlanApproval: Automatic name: "{{ supported_apps[mas_app_id]['csv_name'] }}" source: "{{ mas_catalog_source }}" sourceNamespace: openshift-marketplace diff --git a/ibm/mas_devops/roles/suite_install/README.md b/ibm/mas_devops/roles/suite_install/README.md index bac9dc552..f5479ae4b 100644 --- a/ibm/mas_devops/roles/suite_install/README.md +++ b/ibm/mas_devops/roles/suite_install/README.md @@ -1,7 +1,6 @@ suite_install =============================================================================== - -This role install Maximo Application Suite. It internally resolve the namespace based on the `mas_instance_id` as `mas-{mas_instance_id}-core`. By default this role install MAS Operator using Manual Upgrade Strategy. Set `MAS_UPGRADE_STRATEGY` environment variable to Automatic to override it. In the `Manual` upgrade mode, IBM Common Services operators requested by MAS will inherit the upgrade strategy from MAS and their pending install plans approved. +This role install Maximo Application Suite. It internally resolve the namespace based on the `mas_instance_id` as `mas-{mas_instance_id}-core`. Role Variables @@ -42,9 +41,6 @@ Directory containing configuration files (`*.yaml` and `*.yml`) to be applied to ### certManager.namespace The namespace containing the cert-manager to be used by MAS -### mas_upgrade_strategy -The Upgrade strategy for MAS Operator. Default is set to Automatic - ### mas_annotations Provide a list of comma-separated key=value pairs which will be applied as labels on all resources created. This variable takes a comma separated list of annotations. For example, to deploy your suite in non production mode, set this to `mas.ibm.com/operationalMode=nonproduction` or set `MAS_ANNOTATIONS` environment variable as `export MAS_ANNOTATIONS=mas.ibm.com/operationalMode=nonproduction` diff --git a/ibm/mas_devops/roles/suite_install/defaults/main.yml b/ibm/mas_devops/roles/suite_install/defaults/main.yml index 693e7f178..74f636e88 100644 --- a/ibm/mas_devops/roles/suite_install/defaults/main.yml +++ b/ibm/mas_devops/roles/suite_install/defaults/main.yml @@ -34,20 +34,6 @@ mas_entitlement_key: "{{ lookup('env', 'MAS_ENTITLEMENT_KEY') | default(ibm_enti mas_add_catalog: "{{ lookup('env', 'MAS_ADD_CATALOG') | default('ibm-operator-catalog', true) }}" mas_add_channel: "{{ lookup('env', 'MAS_ADD_CHANNEL') }}" -# Manual upgrade support -# ----------------------------------------------------------------------------- -# Following variables are used when MAS Operator upgrade is set to Manual. -# it contains the ibm-common-services namespace and the list of labels from -# the Subcriptions created by MAS installation. -mas_upgrade_strategy: "{{ lookup('env', 'MAS_UPGRADE_STRATEGY') | default('Automatic', true) }}" - -ibm_common_services_namespace: ibm-common-services -ibm_common_services_subscription_labels: - - ibm-common-service-operator.ibm-common-services - - ibm-namespace-scope-operator.ibm-common-services - - ibm-odlm.ibm-common-services - - ibm-licensing-operator-app.ibm-common-services - # MAS Annotation block # ----------------------------------------------------------------------------- mas_annotations: "{{ lookup('env', 'MAS_ANNOTATIONS') | default(None, true) }}" diff --git a/ibm/mas_devops/roles/suite_install/tasks/ibm-common-services.yml b/ibm/mas_devops/roles/suite_install/tasks/ibm-common-services.yml deleted file mode 100644 index bc7bd9b00..000000000 --- a/ibm/mas_devops/roles/suite_install/tasks/ibm-common-services.yml +++ /dev/null @@ -1,63 +0,0 @@ -# 1. Lookup Common Services Operator Install Plans and approve -# ---------------------------------------------------------------------------- -- name: Debug Operator name - debug: - msg: "{{item}}" - -- name: "Verify if ibm operator is already installed" - kubernetes.core.k8s_info: - api_version: operators.coreos.com/v1alpha1 - kind: Subscription - namespace: "{{ ibm_common_services_namespace }}" - label_selectors: - - "operators.coreos.com/{{item}}" - register: _item_subscription - -- name: Lookup and Approve IBM Common Services operators - block: - - name: "Lookup and wait for Operator subscription to exist" - kubernetes.core.k8s_info: - api_version: operators.coreos.com/v1alpha1 - kind: Subscription - namespace: "{{ ibm_common_services_namespace }}" - label_selectors: - - "operators.coreos.com/{{item}}" - register: _item_subscription_result - retries: 20 - delay: 60 # Retry for approx 20 minutes (60s * 20 attempts) before giving up - until: _item_subscription_result.resources | length > 0 - - - name: Lookup Operator install plan - kubernetes.core.k8s_info: - api_version: operators.coreos.com/v1alpha1 - kind: InstallPlan - namespace: "{{ ibm_common_services_namespace }}" - label_selectors: - - "operators.coreos.com/{{item}}" - register: item_install_plan - retries: 20 - delay: 60 # Retry for approx 20 minutes (60s * 20 attempts) before giving up - until: item_install_plan.resources | length > 0 - when: - - _item_subscription_result.resources | length > 0 - - _item_subscription_result.resources[0].status is defined - - _item_subscription_result.resources[0].status.state != "AtLatestKnown" - - - name: Approve the subscription install plan - when: - - _item_subscription_result.resources[0].status.state != "AtLatestKnown" - - _item_subscription_result.resources[0].status is defined - - item_install_plan.resources | length > 0 - - item_install_plan.resources[0].status is defined - - item_install_plan.resources[0].status.phase != "Complete" - kubernetes.core.k8s: - definition: - apiVersion: operators.coreos.com/v1alpha1 - kind: InstallPlan - metadata: - name: "{{ item_install_plan.resources[0].metadata.name }}" - namespace: "{{ ibm_common_services_namespace }}" - spec: - approved: true - when: - - (_item_subscription.resources | length == 0 or _item_subscription.resources[0].status.state == 'UpgradePending') diff --git a/ibm/mas_devops/roles/suite_install/tasks/main.yml b/ibm/mas_devops/roles/suite_install/tasks/main.yml index c6596e8b9..9bd5daa93 100644 --- a/ibm/mas_devops/roles/suite_install/tasks/main.yml +++ b/ibm/mas_devops/roles/suite_install/tasks/main.yml @@ -159,7 +159,6 @@ - "MAS ICR cp content ............ {{ mas_icr_cp }}" - "MAS ICR cpopen content ........ {{ mas_icr_cpopen }}" - "MAS Cluster Issuer ............ {{ mas_cluster_issuer }}" - - "MAS Subscription Upgrade ...... {{ mas_upgrade_strategy }}" - "IPv6 Enabled .................. {{ enable_ipv6 }}" # 6. Install the operator & create entitlement secret @@ -175,35 +174,6 @@ operator_group: "{{ lookup('template', 'templates/operator-group.yml.j2') }}" subscription: "{{ lookup('template', 'templates/subscription.yml.j2') }}" -- name: Lookup and Approve MAS Subscription - when: mas_upgrade_strategy == 'Manual' - block: - - name: Lookup Operator install plan - kubernetes.core.k8s_info: - api_version: operators.coreos.com/v1alpha1 - kind: InstallPlan - namespace: "{{ mas_namespace }}" - label_selectors: - - "operators.coreos.com/ibm-mas.{{ mas_namespace }}" - register: mas_install_plan - retries: 20 - delay: 60 # Retry for approx 20 minutes (60s * 20 attempts) before giving up - until: mas_install_plan.resources | length > 0 - - - name: Approve the subscription install plan - when: - - mas_install_plan.resources | length > 0 - - mas_install_plan.resources[0].status.phase != "Complete" - kubernetes.core.k8s: - definition: - apiVersion: operators.coreos.com/v1alpha1 - kind: InstallPlan - metadata: - name: "{{ mas_install_plan.resources[0].metadata.name }}" - namespace: "{{ mas_namespace }}" - spec: - approved: true - # 7. Wait until the Suite CRD is available # ----------------------------------------------------------------------------- - name: "Wait until the Suite CRD is available" @@ -249,12 +219,3 @@ - name: debug suiteResult debug: msg: "{{ suiteResult }}" - -# 10. Handle IBM Common Services Install plan approvals when upgrade strategy is set to Manual -# ----------------------------------------------------------------------------- -# ibm-common-services operators deployed by MAS will inherit the inherit MAS upgrade strategy -# when its set to Manual, we need to iterate those to ensure we do approve the first install plan -# otherwise MAS installation wont succeed. -- include_tasks: tasks/ibm-common-services.yml - when: mas_upgrade_strategy == 'Manual' - loop: "{{ibm_common_services_subscription_labels}}" diff --git a/ibm/mas_devops/roles/suite_install/templates/subscription.yml.j2 b/ibm/mas_devops/roles/suite_install/templates/subscription.yml.j2 index cce736267..d6274123f 100644 --- a/ibm/mas_devops/roles/suite_install/templates/subscription.yml.j2 +++ b/ibm/mas_devops/roles/suite_install/templates/subscription.yml.j2 @@ -12,7 +12,7 @@ metadata: {% endif %} spec: channel: "{{ mas_channel }}" - installPlanApproval: "{{ mas_upgrade_strategy }}" + installPlanApproval: Automatic name: ibm-mas source: "{{ mas_catalog_source }}" sourceNamespace: openshift-marketplace