Skip to content

Commit

Permalink
Merge pull request #764 from IBM/cp4ba-20240802
Browse files Browse the repository at this point in the history
CP4BA 24 iFix1 and more
  • Loading branch information
fketelaars authored Aug 19, 2024
2 parents 666c1d2 + 5f2f54c commit a6db878
Show file tree
Hide file tree
Showing 33 changed files with 237 additions and 176 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: "{{ common_route_name }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ rpa_action: "{{ global_action }}"
rpa_universal_password: "{{ universal_password }}"
rpa_storage_class_name: "{{ storage_class_name }}"
rpa_mail_hostname: "{{ mail_hostname }}"
rpa_mssql_project: "{{ mssql_project_name }}"
rpa_mssql_hostname: "{{ mssql_hostname }}"
rpa_project_name: "{{ main_project_name }}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ cp4ba_dir_name: cp4ba
cp4ba_operator_channel: v24.0
## Should not be changed in particular guide version.
## Version of cert-kubernetes folder from Cloud Pak CASE archive e.g. 21.0.1
cp4ba_cert_k8s_branch: 24.0.0
cp4ba_cert_k8s_branch: 24.0.0-IF001
cp4ba_storage_class_name: ""
cp4ba_block_storage_class_name: ""
## Should not be changed in particular guide version.
## Version of Cloud Pak e.g. 20.0.2.1, 20.0.3
cp4ba_version: 24.0.0
## Version in CPFS catalog CatalogSource
cpfs_cs_version: v4-6-2
cpfs_cs_version: v4-6-4
## Name of the CP4BA instance in cr.yaml at path metadata.name
cp4ba_cr_meta_name: icp4adeploy
## Name of OCP CP4BA project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,29 @@
EOF"
register: command_status

- name: ADP proj1 DB
- name: ADP proj DBs
kubernetes.core.k8s_exec:
namespace: "{{ cp4ba_postgresql_project }}"
pod: "{{ postgresql_pod.resources[0].metadata.name }}"
command: >
bash -c "
psql postgresql://postgres:$POSTGRES_PASSWORD@localhost:5432 <<-EOF
-- create user proj1
CREATE ROLE proj1 WITH INHERIT LOGIN ENCRYPTED PASSWORD '{{ cp4ba_postgresql_universal_password }}';
-- create user {{ item }}
CREATE ROLE {{ item }} WITH INHERIT LOGIN ENCRYPTED PASSWORD '{{ cp4ba_postgresql_universal_password }}';
-- create database proj1
create database proj1 owner proj1 template template0 encoding UTF8;
revoke connect on database proj1 from public;
grant all privileges on database proj1 to proj1;
-- create database {{ item }}
create database {{ item }} owner {{ item }} template template0 encoding UTF8;
revoke connect on database {{ item }} from public;
grant all privileges on database {{ item }} to {{ item }};
EOF"
register: command_status
with_items:
- proj1
- proj2
- proj3
- proj4
- proj5
- proj6

- name: ADP proj2 DB
kubernetes.core.k8s_exec:
Expand Down Expand Up @@ -147,7 +154,7 @@
retries: 5
failed_when: command_status.rc != 0 and (command_status.stderr + command_status.stdout) is not search('.*already exists.*')

- name: ADP init proj1 DB
- name: ADP init proj DBs
kubernetes.core.k8s_exec:
namespace: "{{ cp4ba_postgresql_project }}"
pod: postgresql-0
Expand All @@ -158,7 +165,7 @@
export db_port=5432;
export db_server_for_ca={{ cp4ba_postgresql_hostname }};
export db_port_for_ca=5432;
export db_adm_username=proj1;
export db_adm_username={{ item }};
export db_adm_pwd={{ cp4ba_postgresql_universal_password }};
export db_adm_pwd_b64_encoded=0;
export base_db_name=adpbase;
Expand All @@ -169,52 +176,10 @@
export base_valid_user=1;
export base_pwdconfirmed=1;
export tenant_type=0;
export tenant_id=proj1;
export tenant_db_name=proj1;
export tenant_dsn_name=proj1;
export tenant_db_user=proj1;
export user_already_defined=1;
export tenant_pwdconfirmed=1;
export tenant_db_pwd={{ cp4ba_postgresql_universal_password }};
export tenant_db_pwd_b64_encoded=0;
export tenant_ontology=default;
export confirmation=y;
export ssl=No;
export table_space_already_defined=1;
export tablespace_name=pg_default;
./InitTenantDB.sh;
'
register: command_status
until: command_status.rc == 0
retries: 5
failed_when: command_status.rc != 0 and (command_status.stderr + command_status.stdout) is not search('.*already exists.*')

- name: ADP init proj2 DB
kubernetes.core.k8s_exec:
namespace: "{{ cp4ba_postgresql_project }}"
pod: postgresql-0
command: >
bash -c '
cd /tmp/_adp_tmp/PG;
export db_server={{ cp4ba_postgresql_hostname }};
export db_port=5432;
export db_server_for_ca={{ cp4ba_postgresql_hostname }};
export db_port_for_ca=5432;
export db_adm_username=proj2;
export db_adm_pwd={{ cp4ba_postgresql_universal_password }};
export db_adm_pwd_b64_encoded=0;
export base_db_name=adpbase;
export base_db_user=adpbase;
export base_db_pwd={{ cp4ba_postgresql_universal_password }};
export base_db_pwd_b64_encoded=0;
export base_user_already_defined=1;
export base_valid_user=1;
export base_pwdconfirmed=1;
export tenant_type=0;
export tenant_id=proj2;
export tenant_db_name=proj2;
export tenant_dsn_name=proj2;
export tenant_db_user=proj2;
export tenant_id={{ item }};
export tenant_db_name={{ item }};
export tenant_dsn_name={{ item }};
export tenant_db_user={{ item }};
export user_already_defined=1;
export tenant_pwdconfirmed=1;
export tenant_db_pwd={{ cp4ba_postgresql_universal_password }};
Expand All @@ -230,3 +195,10 @@
until: command_status.rc == 0
retries: 5
failed_when: command_status.rc != 0 and (command_status.stderr + command_status.stdout) is not search('.*already exists.*')
with_items:
- proj1
- proj2
- proj3
- proj4
- proj5
- proj6
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,10 @@
ic_css_index_area: "{{ cr_bck.spec.initialize_configuration.ic_css_index_area +
cr.spec.initialize_configuration.ic_css_index_area }}"
ic_enable_cbr: "{{ cr_bck.spec.initialize_configuration.ic_enable_cbr + cr.spec.initialize_configuration.ic_enable_cbr }}"
verify_configuration:
vc_cpe_verification:
vc_cpe_cbr: "{{ cr_bck.spec.verify_configuration.vc_cpe_verification.vc_cpe_cbr +
cr.spec.verify_configuration.vc_cpe_verification.vc_cpe_cbr }}"
when: _current_cp4ba_cluster.cp4ba.patterns.content.enabled and _current_cp4ba_cluster.cp4ba.patterns.content.optional_components.css

# Based on https://www.ibm.com/docs/en/cloud-paks/cp-biz-automation/latest?topic=resource-configuring-business-automation-workflow-authoring
Expand Down Expand Up @@ -376,6 +380,22 @@
verify_configuration:
vc_icn_verification: "{{ cr_bck.spec.verify_configuration.vc_icn_verification + cr.spec.verify_configuration.vc_icn_verification }}"

- name: Combine lists back to CR with CSS
ansible.builtin.set_fact:
cr: "{{ cr | combine(list_overwrites, recursive=true) }}"
vars:
list_overwrites:
spec:
initialize_configuration:
ic_css_index_area: "{{ cr_bck.spec.initialize_configuration.ic_css_index_area +
cr.spec.initialize_configuration.ic_css_index_area }}"
ic_enable_cbr: "{{ cr_bck.spec.initialize_configuration.ic_enable_cbr + cr.spec.initialize_configuration.ic_enable_cbr }}"
verify_configuration:
vc_cpe_verification:
vc_cpe_cbr: "{{ cr_bck.spec.verify_configuration.vc_cpe_verification.vc_cpe_cbr +
cr.spec.verify_configuration.vc_cpe_verification.vc_cpe_cbr }}"
when: _current_cp4ba_cluster.cp4ba.patterns.content.enabled and _current_cp4ba_cluster.cp4ba.patterns.content.optional_components.css

- name: Add patterns to CR
ansible.builtin.set_fact:
cr: "{{ cr | combine(patterns_insert, recursive=true) }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
- Case administration: https://cpd-{{ cp4ba_project_name }}.{{ apps_endpoint_domain }}/icn/navigator/?desktop=bawadmin
- Case REST endpoint: https://cpd-{{ cp4ba_project_name }}.{{ apps_endpoint_domain }}/bas/CaseManager/CASEREST/
- Case REST endpoint: https://cpd-{{ cp4ba_project_name }}.{{ apps_endpoint_domain }}/bas/CaseManager/CASEREST/v2
- Case Builder: https://cpd-{{ cp4ba_project_name }}.{{ apps_endpoint_domain }}/bas/CaseBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
api_version: v1
kind: Secret
namespace: "{{ cp4ba_project_name }}"
name: "ibm-bts-cnpg-{{ cp4ba_project_name }}-{{ cp4ba_project_name }}-bts-app"
name: "ibm-bts-cnpg-{{ cp4ba_project_name }}-cp4ba-bts-app"
register: bts_pg_secret
retries: 40
delay: 15
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
- ibm-events-operator-catalog
- cloud-native-postgresql-catalog
- ibm-fncm-operator-catalog
- ibm-bai-operator-catalog

- name: Manage Operator
ansible.builtin.include_tasks: predeploy/operator.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@
- ibm-events-operator-catalog
- cloud-native-postgresql-catalog
- ibm-fncm-operator-catalog
- ibm-bai-operator-catalog

# Based on https://www.ibm.com/docs/en/cpfs?topic=online-uninstalling-foundational-services

Expand Down Expand Up @@ -320,6 +319,10 @@
- adpbase
- proj1
- proj2
- proj3
- proj4
- proj5
- proj6

- name: Remove PostgreSQL tablespaces
ansible.builtin.include_role:
Expand Down Expand Up @@ -367,6 +370,10 @@
- adpbase
- proj1
- proj2
- proj3
- proj4
- proj5
- proj6

- name: Remove post-deploy.md Config Map
kubernetes.core.k8s:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ stringData:
BASE_DB_CONFIG: "{{ cp4ba_postgresql_universal_password }}"
PROJ1_DB_CONFIG: "{{ cp4ba_postgresql_universal_password }}"
PROJ2_DB_CONFIG: "{{ cp4ba_postgresql_universal_password }}"
PROJ3_DB_CONFIG: "{{ cp4ba_postgresql_universal_password }}"
PROJ4_DB_CONFIG: "{{ cp4ba_postgresql_universal_password }}"
PROJ5_DB_CONFIG: "{{ cp4ba_postgresql_universal_password }}"
PROJ6_DB_CONFIG: "{{ cp4ba_postgresql_universal_password }}"
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ spec:
tenant_databases:
- proj1
- proj2
- proj3
- proj4
- proj5
- proj6
database_port: "5432"
dc_database_ssl_enabled: false
dc_os_datasources:
Expand Down Expand Up @@ -65,7 +69,7 @@ spec:
add_desktop_name: DEVOS1
add_desktop_description: DEVOS1
add_desktop_repo_id: DEVOS1
{% if _current_cp4ba_cluster.cp4ba.patterns.content.enabled and _current_cp4ba_cluster.cp4ba.patterns.content.optional_components.css %}
{% if _current_cp4ba_cluster.cp4ba.patterns.content.optional_components.css %}
ic_css_index_area:
- object_store_name: DEVOS1
index_area_name: devos1_index_area
Expand All @@ -76,3 +80,8 @@ spec:
vc_icn_verification:
- vc_icn_repository: DEVOS1
vc_icn_desktop_id: DEVOS1
{% if _current_cp4ba_cluster.cp4ba.patterns.content.optional_components.css %}
vc_cpe_verification:
vc_cpe_cbr:
- cbr_cpe_obj_store_name: DEVOS1
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ stringData:
<!-- SMTP server that mail should be sent to -->
<smtp-server merge="replace">{{ cp4ba_mail_hostname }}</smtp-server>
<mail-template>
<use-gadget>true</use-gadget>
<process>externalmailprocesslink_{0}.html</process>
<no-process>externalmailnoprocess_{0}.html</no-process>
</mail-template>
<valid-from-required merge="replace">true</valid-from-required>
<default-from-address merge="replace">[email protected]</default-from-address>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,23 @@ spec:
add_desktop_name: BAWTOS
add_desktop_description: BAWTOS
add_desktop_repo_id: BAWTOS
{% if _current_cp4ba_cluster.cp4ba.patterns.content.optional_components.css %}
ic_css_index_area:
- object_store_name: BAWTOS
index_area_name: bawtos_index_area
ic_enable_cbr:
- object_store_name: BAWTOS
{% endif %}
verify_configuration:
vc_icn_verification:
- vc_icn_repository: BAWDOCS
vc_icn_desktop_id: BAWDOCS
vc_icn_desktop_id: BAWDOCS
- vc_icn_repository: BAWDOS
vc_icn_desktop_id: BAWDOS
vc_icn_desktop_id: BAWDOS
- vc_icn_repository: BAWTOS
vc_icn_desktop_id: BAWTOS
vc_icn_desktop_id: BAWTOS
{% if _current_cp4ba_cluster.cp4ba.patterns.content.optional_components.css %}
vc_cpe_verification:
vc_cpe_cbr:
- cbr_cpe_obj_store_name: BAWTOS
{% endif %}
Loading

0 comments on commit a6db878

Please sign in to comment.