diff --git a/docs/playbooks/backup-restore.md b/docs/playbooks/backup-restore.md index e254780a2..f702de754 100644 --- a/docs/playbooks/backup-restore.md +++ b/docs/playbooks/backup-restore.md @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 ``` diff --git a/ibm/mas_devops/playbooks/br_manage.yml b/ibm/mas_devops/playbooks/br_manage.yml index c4fa4c012..baef19832 100644 --- a/ibm/mas_devops/playbooks/br_manage.yml +++ b/ibm/mas_devops/playbooks/br_manage.yml @@ -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"] @@ -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: