Skip to content

Commit a1a6fc8

Browse files
authored
Merge pull request #1111 from IBM/fk-misc
Miscellaneous changes
2 parents f4466dd + da3edba commit a1a6fc8

25 files changed

Lines changed: 1112 additions & 164 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
apply-entitlement \
22
--cpd_instance_ns={{ current_cp4d_cluster.project }} \
33
--entitlement={{ _p_entitlement }} \
4-
--production={{ _p_cp4d_production_license }} {% if _p_cp4d_version < '5.3.0' %}--apply_branding=true{% endif %}
4+
--production={{ _p_cp4d_production_license | string | lower }} {% if _p_cp4d_version < '5.3.0' %}--apply_branding=true{% endif %}

automation-roles/50-install-cloud-pak/cp4d/cp4d-cartridge-install/tasks/cp4d-install-separate-cr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- include_tasks: cp4d-install-cartridges-install-components.yml
1515
vars:
1616
_p_apply_cartridges_list: "{{ _current_cp4d_cartridge.olm_utils_name }}"
17+
_p_cp4d_upgrade: "{{ _current_cp4d_cartridge.upgrade_cartridge | default(False) }}"
1718
when:
1819
- not _install_cr_script.stat.exists
1920
- _p_cp4d_version >= '5.3.0'

automation-roles/50-install-cloud-pak/cp4d/cp4d-cartridge-install/tasks/main.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,22 @@
4343
- _apply_cr_cartridges_list != ''
4444
- _p_cp4d_version < '5.3.0'
4545

46-
- include_tasks: cp4d-install-cartridges-install-components.yml
46+
- name: Install cartridges that do not require upgrade
47+
include_tasks: cp4d-install-cartridges-install-components.yml
4748
vars:
48-
_p_apply_cartridges_list: "{{ _apply_cr_cartridges_list }}"
49+
_p_apply_cartridges_list: "{{ _apply_cr_cartridges_no_upgrade_list }}"
50+
_p_cp4d_upgrade: False
4951
when:
50-
- _apply_cr_cartridges_list != ''
52+
- _apply_cr_cartridges_no_upgrade_list != ''
53+
- _p_cp4d_version >= '5.3.0'
54+
55+
- name: Install cartridges that DO require upgrade
56+
include_tasks: cp4d-install-cartridges-install-components.yml
57+
vars:
58+
_p_apply_cartridges_list: "{{ _apply_cr_cartridges_upgrade_list }}"
59+
_p_cp4d_upgrade: True
60+
when:
61+
- _apply_cr_cartridges_upgrade_list != ''
5162
- _p_cp4d_version >= '5.3.0'
5263

5364
- name: Install separate cartridges

automation-roles/50-install-cloud-pak/cp4d/cp4d-cartridge-install/templates/install-components-cartridges.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ install-components \
22
--release={{ _p_cp4d_version }} \
33
--license_acceptance={{ _cpd_accept_licenses | default(False) | string | lower }} \
44
--preview={{ _p_preview_script | default(False) | string | lower }} \
5-
--upgrade={{ _upgrade_cp4d | default(False) | string | lower }} \
5+
--upgrade={{ _p_cp4d_upgrade | default(False) | string | lower }} \
66
--operator_ns={{ _p_current_cp4d_cluster.operators_project }} \
77
--instance_ns={{ _p_current_cp4d_cluster.project }} \
88
{% if _installation_options_set %}

automation-roles/50-install-cloud-pak/cp4d/cp4d-case-save/tasks/main.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22
- include_role:
33
name: cp4d-variables
44

5+
# Get preview of case-download to ensure the patch files are downloaded when --dry-run was selected
6+
- block:
7+
- set_fact:
8+
_case_download_command: "{{ lookup('template', 'case-download.j2') }}"
9+
vars:
10+
_p_preview: True
11+
12+
- name: Run preview of download case files to obtain patch files
13+
shell: |
14+
{{ _case_download_command }}
15+
failed_when: False
16+
environment:
17+
OLM_UTILS_IMAGE: "{{ _olm_utils_image_full }}"
18+
when: cpd_dry_run | bool
19+
520
- name: Generate case-download command to download case files
621
set_fact:
722
_case_download_command: "{{ lookup('template', 'case-download.j2') }}"
@@ -21,8 +36,12 @@
2136
path: "{{ status_dir }}/work/offline"
2237
state: absent
2338

24-
- name: Copy case files to {{ status_dir }}/work/offline/{{ _p_cp4d_version }}
39+
- name: Copy case files and patch info to {{ status_dir }}/work
2540
copy:
2641
src: "/tmp/work/"
2742
dest: "{{ status_dir }}/work/"
28-
remote_src: True
43+
remote_src: True
44+
45+
# Update cartridge versions in cartridges_to_install fact
46+
- include_role:
47+
name: cp4d-variables

automation-roles/50-install-cloud-pak/cp4d/cp4d-case-save/templates/case-download.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@ case-download \
88
--scheduler_ns={{ scheduling_service_project }} \
99
--cluster_resources=true \
1010
{% endif -%}
11+
{% if _p_preview | default(False) %}
12+
--preview=true \
13+
{% endif %}
1114
--components=ibm-cert-manager,ibm-licensing,{{ _cartridges_to_install_list }}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
- include_role:
3+
name: run-command
4+
vars:
5+
_p_command_description: Install cluster-scoped resources using file {{ status_dir }}/work/cluster_scoped_resources.yaml
6+
_p_command: "{{ lookup('template','apply_cluster_scoped_forced.j2') }}"
7+
_p_command_log_file: "{{ status_dir }}/log/{{ current_cp4d_cluster.project }}-apply-cluster-scoped-resources.log"

automation-roles/50-install-cloud-pak/cp4d/cp4d-cluster/tasks/install-cp4d.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
_p_current_cp4d_cluster: "{{ current_cp4d_cluster }}"
4141
when: not (cpd_airgap | bool)
4242

43+
- include_tasks: apply-cluster-scoped-resources.yml
44+
when: _p_cp4d_version >= "5.3.0"
45+
4346
- name: Prepare OpenShift project {{ current_cp4d_cluster.project }} for Cloud Pak for Data
4447
include_tasks: openshift-prepare-project.yml
4548

@@ -49,6 +52,12 @@
4952
vars:
5053
_p_current_cp4d_cluster: "{{ current_cp4d_cluster }}"
5154

55+
- name: Obtain control plane
56+
set_fact:
57+
_cpd_control_plane: "{{ _cartridges_to_install | json_query(jmes_query) | first }}"
58+
vars:
59+
jmes_query: "[?olm_utils_name=='cpd_platform']"
60+
5261
- include_tasks: install-control-plane-olm-utils.yml
5362
when: _p_cp4d_version < "5.1.0"
5463

automation-roles/50-install-cloud-pak/cp4d/cp4d-cluster/tasks/install-software-hub-component.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
---
2-
- include_role:
3-
name: run-command
4-
vars:
5-
_p_command_description: Install cluster-scoped resources using file {{ status_dir }}/work/cluster_scoped_resources.yaml
6-
_p_command: "{{ lookup('template','apply_cluster_scoped_forced.j2') }}"
7-
_p_command_log_file: "{{ status_dir }}/log/{{ current_cp4d_cluster.project }}-apply-cluster-scoped-resources.log"
8-
92
- block:
103
- name: Generate install-components command for project {{ current_cp4d_cluster.project }} to install Software Hub
114
set_fact:

automation-roles/50-install-cloud-pak/cp4d/cp4d-cluster/templates/apply-cr-cpd-platform.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply-cr \
22
--release={{ _p_cp4d_version }} \
33
--license_acceptance={{ _cpd_accept_licenses | default(False) | string | lower }} \
44
--preview={%- if _p_preview_script -%}true{%- else -%}false{%- endif %} \
5-
--upgrade={{ _upgrade_cp4d | default(False) | string | lower }} \
5+
--upgrade={{ _cpd_control_plane.upgrade_cartridge | default(False) | string | lower }} \
66
-v \
77
--cpd_instance_ns={{ current_cp4d_cluster.project }} \
88
--file_storage_class={{ ocp_storage_class_file }} \

0 commit comments

Comments
 (0)