-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #243 from IBM/cpd-460
OLM patching and Cloud Pak for Data 4.6 support
- Loading branch information
Showing
27 changed files
with
463 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...ation-roles/50-install-cloud-pak/cp4d/cp4d-cartridge-install/tasks/cp4d-install-cr-dp.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
- name: "Install cartridge {{ _current_cp4d_cartridge.olm_utils_name }}" | ||
debug: | ||
msg: "" | ||
|
||
- name: Ensure that OLM utils work directory exists | ||
file: | ||
path: /tmp/work | ||
state: directory | ||
|
||
# Always generate the preview script to log what will be done | ||
- name: "Generate command preview script to install cartridge {{ _current_cp4d_cartridge.olm_utils_name }}" | ||
set_fact: | ||
_apply_cr_command_script: "{{ lookup('template', 'apply-cr-dp.j2') }}" | ||
vars: | ||
_p_preview_script: True | ||
|
||
- name: Show apply-cr command to install cartridges | ||
debug: | ||
var: _apply_cr_command_script | ||
|
||
- name: Generate preview script to install cartridge {{ _current_cp4d_cartridge.olm_utils_name }}, logs are in {{ status_dir }}/log/{{ _p_current_cp4d_cluster.project }}-apply-cr-cartridges.log | ||
shell: | | ||
{{ _apply_cr_command_script }} > {{ status_dir }}/log/{{ _p_current_cp4d_cluster.project }}-apply-cr-cartridges.log 2>&1 | ||
- name: Copy script to {{ status_dir }}/cp4d/{{ _p_current_cp4d_cluster.project }}-apply-cr-dp.sh | ||
copy: | ||
src: "/tmp/work/preview.sh" | ||
dest: "{{ status_dir }}/cp4d/{{ _p_current_cp4d_cluster.project }}-apply-cr-dp.sh" | ||
remote_src: True | ||
mode: u+rwx | ||
|
||
- name: Run apply-cr command to install cartridge {{ _current_cp4d_cartridge.olm_utils_name }} | ||
block: | ||
- name: Generate apply-cr command to install cartridge {{ _current_cp4d_cartridge.olm_utils_name }} | ||
set_fact: | ||
_apply_cr_command: "{{ lookup('template', 'apply-cr-dp.j2') }}" | ||
vars: | ||
_p_preview_script: False | ||
- name: Run apply-cr command to install cartridge {{ _current_cp4d_cartridge.olm_utils_name }}, logs are in {{ status_dir }}/log/{{ _p_current_cp4d_cluster.project }}-apply-cr-cartridges.log | ||
shell: | | ||
{{ _apply_cr_command }} > {{ status_dir }}/log/{{ _p_current_cp4d_cluster.project }}-apply-cr-cartridges.log 2>&1 | ||
register: _install_cartridges_result | ||
failed_when: False | ||
- name: Fail if there was an error installing the cartridge {{ _current_cp4d_cartridge.olm_utils_name }} using apply-cr | ||
fail: | ||
msg: "{{ _install_cartridges_result }}" | ||
when: | ||
- _install_cartridges_result.rc!=0 | ||
- not (cpd_test_cartridges | default(False) | bool) | ||
- set_fact: | ||
_cp4d_cartridges_installed_successfully: False | ||
when: _install_cartridges_result.rc!=0 | ||
when: _sequential_install | ||
|
||
- name: Run shell script to install cartridge {{ _current_cp4d_cartridge.olm_utils_name }}, logs are in {{ status_dir }}/log/{{ _p_current_cp4d_cluster.project }}-apply-cr-cartridges.log | ||
shell: | | ||
{{ status_dir }}/cp4d/{{ _p_current_cp4d_cluster.project }}-apply-cr-dp.sh >> {{ status_dir }}/log/{{ _p_current_cp4d_cluster.project }}-apply-cr-cartridges.log 2>&1 | ||
when: not _sequential_install |
64 changes: 64 additions & 0 deletions
64
...es/50-install-cloud-pak/cp4d/cp4d-cartridge-install/tasks/cp4d-install-cr-replication.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
- name: "Install cartridge {{ _current_cp4d_cartridge.olm_utils_name }}" | ||
debug: | ||
msg: "" | ||
|
||
- name: Ensure that OLM utils work directory exists | ||
file: | ||
path: /tmp/work | ||
state: directory | ||
|
||
- name: Write license type to /tmp/work/replication-install-options.yml | ||
copy: | ||
content: "license_type: {{ _current_cp4d_cartridge.license }}" | ||
dest: "/tmp/work/replication-install-options.yml" | ||
|
||
# Always generate the preview script to log what will be done | ||
- name: "Generate command preview script to install cartridge {{ _current_cp4d_cartridge.olm_utils_name }}" | ||
set_fact: | ||
_apply_cr_command_script: "{{ lookup('template', 'apply-cr-replication.j2') }}" | ||
vars: | ||
_p_preview_script: True | ||
|
||
- name: Show apply-cr command to install cartridges | ||
debug: | ||
var: _apply_cr_command_script | ||
|
||
- name: Generate preview script to install cartridge {{ _current_cp4d_cartridge.olm_utils_name }}, logs are in {{ status_dir }}/log/{{ _p_current_cp4d_cluster.project }}-apply-cr-cartridges.log | ||
shell: | | ||
{{ _apply_cr_command_script }} > {{ status_dir }}/log/{{ _p_current_cp4d_cluster.project }}-apply-cr-cartridges.log 2>&1 | ||
- name: Copy script to {{ status_dir }}/cp4d/{{ _p_current_cp4d_cluster.project }}-apply-cr-replication.sh | ||
copy: | ||
src: "/tmp/work/preview.sh" | ||
dest: "{{ status_dir }}/cp4d/{{ _p_current_cp4d_cluster.project }}-apply-cr-replication.sh" | ||
remote_src: True | ||
mode: u+rwx | ||
|
||
- name: Run apply-cr command to install cartridge {{ _current_cp4d_cartridge.olm_utils_name }} | ||
block: | ||
- name: Generate apply-cr command to install cartridge {{ _current_cp4d_cartridge.olm_utils_name }} | ||
set_fact: | ||
_apply_cr_command: "{{ lookup('template', 'apply-cr-replication.j2') }}" | ||
vars: | ||
_p_preview_script: False | ||
- name: Run apply-cr command to install cartridge {{ _current_cp4d_cartridge.olm_utils_name }}, logs are in {{ status_dir }}/log/{{ _p_current_cp4d_cluster.project }}-apply-cr-cartridges.log | ||
shell: | | ||
{{ _apply_cr_command }} > {{ status_dir }}/log/{{ _p_current_cp4d_cluster.project }}-apply-cr-cartridges.log 2>&1 | ||
register: _install_cartridges_result | ||
failed_when: False | ||
- name: Fail if there was an error installing the cartridge {{ _current_cp4d_cartridge.olm_utils_name }} using apply-cr | ||
fail: | ||
msg: "{{ _install_cartridges_result }}" | ||
when: | ||
- _install_cartridges_result.rc!=0 | ||
- not (cpd_test_cartridges | default(False) | bool) | ||
- set_fact: | ||
_cp4d_cartridges_installed_successfully: False | ||
when: _install_cartridges_result.rc!=0 | ||
when: _sequential_install | ||
|
||
- name: Run shell script to install cartridge {{ _current_cp4d_cartridge.olm_utils_name }}, logs are in {{ status_dir }}/log/{{ _p_current_cp4d_cluster.project }}-apply-cr-cartridges.log | ||
shell: | | ||
{{ status_dir }}/cp4d/{{ _p_current_cp4d_cluster.project }}-apply-cr-replication.sh >> {{ status_dir }}/log/{{ _p_current_cp4d_cluster.project }}-apply-cr-cartridges.log 2>&1 | ||
when: not _sequential_install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...roles/50-install-cloud-pak/cp4d/cp4d-cartridge-install/tasks/cp4d-install-separate-cr.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
- include_tasks: "{{ role_path }}/tasks/cp4d-install-cr-{{ _current_cp4d_cartridge.olm_utils_name }}.yml" | ||
when: | ||
- (_current_cp4d_cartridge.state | default('installed')) == 'installed' | ||
- (_current_cp4d_cartridge.separate_install | default(False) | bool) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
automation-roles/50-install-cloud-pak/cp4d/cp4d-cartridge-install/templates/apply-cr-dp.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/opt/ansible/bin/apply-cr \ | ||
--release={{ _p_current_cp4d_cluster.cp4d_version }} \ | ||
--license_acceptance={{ _cpd_accept_licenses | default(False) | string | lower }} \ | ||
--preview={%- if _p_preview_script -%}true{%- else -%}false{%- endif %} \ | ||
--upgrade={%- if _upgrade_cp4d -%}true{%- else -%}false{%- endif %} \ | ||
-v \ | ||
--cpd_instance_ns={{ _p_current_cp4d_cluster.project }} \ | ||
--components={{ _current_cp4d_cartridge.olm_utils_name }} \ | ||
{% if _storage_type == "ocs" -%} | ||
--storage_vendor=ocs --file_storage_class={{ ocp_storage_class_file }} --block_storage_class={{ ocp_storage_class_block }} --storage_class={{ ocp_storage_class_file }} | ||
{%- elif _storage_type == "pwx" -%} | ||
--storage_vendor=portworx | ||
{%- else -%} | ||
--file_storage_class={{ ocp_storage_class_file }} --block_storage_class={{ ocp_storage_class_block }} --storage_class={{ ocp_storage_class_file }} | ||
{%- endif -%} |
16 changes: 16 additions & 0 deletions
16
...-roles/50-install-cloud-pak/cp4d/cp4d-cartridge-install/templates/apply-cr-replication.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/opt/ansible/bin/apply-cr \ | ||
--release={{ _p_current_cp4d_cluster.cp4d_version }} \ | ||
--license_acceptance={{ _cpd_accept_licenses | default(False) | string | lower }} \ | ||
--preview={%- if _p_preview_script -%}true{%- else -%}false{%- endif %} \ | ||
--upgrade={%- if _upgrade_cp4d -%}true{%- else -%}false{%- endif %} \ | ||
-v \ | ||
--cpd_instance_ns={{ _p_current_cp4d_cluster.project }} \ | ||
--components={{ _current_cp4d_cartridge.olm_utils_name }} \ | ||
--param-file=/tmp/work/replication-install-options.yml \ | ||
{% if _storage_type == "ocs" -%} | ||
--storage_vendor=ocs --file_storage_class={{ ocp_storage_class_file }} --block_storage_class={{ ocp_storage_class_block }} --storage_class={{ ocp_storage_class_file }} | ||
{%- elif _storage_type == "pwx" -%} | ||
--storage_vendor=portworx | ||
{%- else -%} | ||
--file_storage_class={{ ocp_storage_class_file }} --block_storage_class={{ ocp_storage_class_block }} --storage_class={{ ocp_storage_class_file }} | ||
{%- endif -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.