Skip to content

Commit

Permalink
Merge pull request #869 from IBM/cp4i-hotfix
Browse files Browse the repository at this point in the history
Cp4i-hotfix
  • Loading branch information
fketelaars authored Dec 30, 2024
2 parents 12c752f + 6b58078 commit 6f87768
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,21 @@
secret_name: "image-registry-{{ current_cp4i_cluster.image_registry_name }}"
secret_group: "{{ environment_name }}"

- name: Validate if container registry credentials secret is available
fail: msg="Container registry credentials secret image-registry-{{ current_cp4i_cluster.image_registry_name }} from group {{ environment_name }} is empty"
when: secret_value== ""
- name: Validate if container registry credentials secret is available
fail: msg="Container registry credentials secret image-registry-{{ current_cp4i_cluster.image_registry_name }} from group {{ environment_name }} is empty"
when: secret_value== ""

- name: Find private registry dedicated to this cluster
set_fact:
_selected_registry: "{{ all_config.image_registry | json_query(query) | first | default({}) }}"
vars:
query: >-
[?name=='{{ current_cp4i_cluster.image_registry_name }}']
- name: Find private registry dedicated to this cluster
set_fact:
_selected_registry: "{{ all_config.image_registry | json_query(query) | first | default({}) }}"
vars:
query: >-
[?name=='{{ current_cp4i_cluster.image_registry_name }}']
- name: Fail if the referenced registry does not exist
fail:
msg: "The registry {{ current_cp4i_cluster.image_registry_name }} is not defined"
when: (_selected_registry | default({})) == {}
- name: Fail if the referenced registry does not exist
fail:
msg: "The registry {{ current_cp4i_cluster.image_registry_name }} is not defined"
when: (_selected_registry | default({})) == {}

- name: Set private registry credentials and properties
set_fact:
Expand All @@ -116,9 +116,9 @@
_private_reg_port: "{{ _selected_registry.registry_port | default('') }}"
_private_reg_namespace: "{{ selected_registry.registry_namespace | default('') }}"

- name: Set private registry URL
set_fact:
_private_reg_url: "{{ lookup('template','private_reg_url.j2') }}"
- name: Set private registry URL
set_fact:
_private_reg_url: "{{ lookup('template','private_reg_url.j2') }}"

when: _private_reg_defined

Expand All @@ -131,17 +131,12 @@
set_fact:
_use_case_files: (current_cp4i_cluster.use_case_files | default(True) | bool)

- name: When using CASE files
block:
- name: Using CASE files specified. Downloading...
include_tasks: download-case-files.yml
- include_tasks: download-case-files.yml
when: _use_case_files

- name: When not using CASE files
block:
- name: Using CASE files is not specified.
debug:
msg: "The online catalog sources will be used during the installation."
- name: Using CASE files is not specified.
debug:
msg: "The online catalog sources will be used during the installation."
when: not _use_case_files

when: not _private_reg_defined
Expand Down Expand Up @@ -205,15 +200,14 @@
when: not (cp4i_sandbox | default(False) | bool)

- name: Reset CP4I directory for generated files
block:
- file:
path: "{{ status_dir }}/cp4i"
state: absent

- name: Create directory status/cp4i
file:
path: "{{ status_dir }}/cp4i"
state: directory
file:
path: "{{ status_dir }}/cp4i"
state: absent

- name: Create directory status/cp4i
file:
path: "{{ status_dir }}/cp4i"
state: directory

- name: Prepare OpenShift cluster for Cloud Pak for Integration
include_role:
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
implemented_cloud_platform_types: ['ibm-cloud', 'existing-ocp','vsphere','aws']
implemented_cloud_platform_types: ['ibm-cloud', 'existing-ocp','vsphere','aws']

_v_entitled_registry: cp.icr.io
_v_entitled_registry_username: cp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
cp4i:
- project: cp4i
openshift_cluster_name: "{{ env_id }}"
cp4i_version: 2022.2.1-0
accept_licenses: False
cp4i_version: 16.1.0.1
accept_licenses: false

instances:

- type: platform-navigator
state: installed
state: installed # installed/removed

- type: api-management
state: removed
Expand All @@ -18,7 +19,7 @@ cp4i:
- type: enterprise-gateway
state: removed

- type: event-endpoint-management
- type: event-endpoint-management # NOTE: Don't use it for cp4i 2022.4 and older
state: removed

- type: event-streams
Expand All @@ -28,13 +29,13 @@ cp4i:
state: removed

- type: integration-dashboard
state: removed
state: installed

- type: integration-design
state: removed

- type: integration-tracing
- type: integration-tracing # NOTE: Don't use it for cp4i 2023.2 and newer
state: removed

- type: messaging
state: removed
state: installed

0 comments on commit 6f87768

Please sign in to comment.