Skip to content

Commit

Permalink
[patch] can skip db2 in br_manage playbook (#1566)
Browse files Browse the repository at this point in the history
Co-authored-by: Sanjay Prabhakar <sanjay.prabhakar@uk.ibm.com>
  • Loading branch information
sanjayprab and Sanjay Prabhakar authored Nov 19, 2024
1 parent 8c8f993 commit 5c595c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
10 changes: 5 additions & 5 deletions docs/playbooks/backup-restore.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ This playbook `ibm.mas_devops.br_manage` will backup the following components th

- `MAS_INSTANCE_ID` **Required**. This playbook only supports backing up components belong to a specific MAS instance at a time. If you have multiple MAS instances in the cluster to be backed up, you need to run this playbook multiple times with different value of this environment variable.
- `MAS_WORKSPACE_ID` **Required**. This playbook only supports backing up components belong to a specific MAS workspace at a time. If you have multiple MAS workspaces in the cluster to be backed up, you need to run this playbook multiple times with different value of this environment variable.
- `DB2_INSTANCE_NAME` **Required**. This playbook will backup the the Db2 instance used by Manage, you need to set the correct Db2 instance name for this environment variable.
- `DB2_INSTANCE_NAME` **Optional**. When defined, this playbook will backup the Db2 instance used by Manage. DB2 role is skipped when environment variable is not defined..

### Examples

Expand All @@ -357,7 +357,7 @@ export MASBR_STORAGE_TYPE=local
export MASBR_STORAGE_LOCAL_FOLDER=/tmp/backup
export MAS_INSTANCE_ID=dev1
export MAS_WORKSPACE_ID=ws1
export DB2_INSTANCE_NAME=mas-dev1-ws1-manage
export DB2_INSTANCE_NAME=mas-dev1-ws1-manage # set this to execute db2 backup role
ansible-playbook ibm.mas_devops.br_manage

# Incremental backup all manage data for the dev1 instance and ws1 workspace
Expand All @@ -367,7 +367,7 @@ export MASBR_STORAGE_TYPE=local
export MASBR_STORAGE_LOCAL_FOLDER=/tmp/backup
export MAS_INSTANCE_ID=dev1
export MAS_WORKSPACE_ID=ws1
export DB2_INSTANCE_NAME=mas-dev1-ws1-manage
export DB2_INSTANCE_NAME=mas-dev1-ws1-manage # set this to execute db2 backup role
ansible-playbook ibm.mas_devops.br_manage

# Restore all manage data for the dev1 instance and ws1 workspace
Expand All @@ -377,7 +377,7 @@ export MASBR_STORAGE_LOCAL_FOLDER=/tmp/backup
export MASBR_RESTORE_FROM_VERSION=20240630132439
export MAS_INSTANCE_ID=dev1
export MAS_WORKSPACE_ID=ws1
export DB2_INSTANCE_NAME=mas-dev1-ws1-manage
export DB2_INSTANCE_NAME=mas-dev1-ws1-manage # set this to execute db2 restore role
ansible-playbook ibm.mas_devops.br_manage

# Create a scheduled backup of all manage data for the dev1 instance and ws1 workspace
Expand All @@ -390,7 +390,7 @@ export MASBR_STORAGE_TYPE=local
export MASBR_STORAGE_LOCAL_FOLDER=/tmp/backup
export MAS_INSTANCE_ID=dev1
export MAS_WORKSPACE_ID=ws1
export DB2_INSTANCE_NAME=mas-dev1-ws1-manage
export DB2_INSTANCE_NAME=mas-dev1-ws1-manage # set this to execute db2 backup role
ansible-playbook ibm.mas_devops.br_manage
```

Expand Down
6 changes: 1 addition & 5 deletions ibm/mas_devops/playbooks/br_manage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@
that: mas_workspace_id is defined and mas_workspace_id != ""
fail_msg: "mas_workspace_id is required"

- name: "Fail if db2_instance_id is not provided"
assert:
that: db2_instance_id is defined and db2_instance_id != ""
fail_msg: "db2_instance_id is required"

- name: "Fail if masbr_action is not set to backup|restore"
assert:
that: masbr_action in ["backup", "restore"]
Expand Down Expand Up @@ -91,6 +86,7 @@
name: ibm.mas_devops.db2
vars:
db2_action: "{{ masbr_action }}"
when: db2_instance_id is defined and db2_instance_id != ""

- name: "MAS Core namespace: {{ masbr_action }}"
include_role:
Expand Down

0 comments on commit 5c595c1

Please sign in to comment.