Skip to content

Collection does not support CLI command: oci db database create-database-create-stand-by-database-details #305

Description

@rwagnergit

Issue Report

Describe the issue

I can use the OCI CLI to provision a standby database using the following command:

oci db database create-database-create-stand-by-database-details --database file://database.json --db-home-id ocid1.dbhome.oc1.eu-frankfurt-1.antheljtqig3rgia3k6acqkoir6juxlfrz3igoakuhgan3gc5fzzdnshywbq

I do not see an OCI Ansible module that offers equivalent functionality. oracle.oci.oci_database_data_guard_association is close, but it does not support passing in the TDE wallet password which is needed to create the standby (i.e., when I use this module to provision a standby, it fails with CDG-50101 : DataGuard provisioning failed at stage CREATE_STANDBY)

Expected behavior

A module with equivalent functionality to oci db database create-database-create-stand-by-database-details is needed.

Environment

  • OS version:
rowagn@vspansible01:~#> cat /etc/redhat-release
Red Hat Enterprise Linux release 8.10 (Ootpa)
  • Ansible version:
rowagn@vspansible01:~#> ansible --version
ansible [core 2.15.8]
  config file = /home/rowagn/ansible.cfg
  configured module search path = ['/home/rowagn/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /sso/sfw/virtualenv/ansible2_15_8/lib/python3.9/site-packages/ansible
  ansible collection location = /home/rowagn/.ansible/collections:/usr/share/ansible/collections
  executable location = /sso/sfw/virtualenv/ansible2_15_8/bin/ansible
  python version = 3.9.18 (main, Jul 18 2024, 11:58:42) [GCC 8.5.0 20210514 (Red Hat 8.5.0-22)] (/sso/sfw/virtualenv/ansible2_15_8/bin/python3)
  jinja version = 3.1.2
  libyaml = True
  • OCI Python SDK version:
rowagn@vspansible01:~#> python -c "import oci;print(oci.__version__)"
2.126.4
  • OCI Ansible Modules version:
oracle.oci         5.1.0

Ansible playbook to reproduce the issue

- hosts: localhost
  gather_facts: no
  tasks:
  - name: Create data_guard_association with creation_type
    oracle.oci.oci_database_data_guard_association:
      # required
      database_id: 'ocid1.database.oc1.eu-frankfurt-1.antheljrtranicia2az2bpcl4pvwlyxxru2ov3d6vfnjgbklfglndq2nbrpa'
      creation_type: ExistingVmCluster
      database_admin_password: 'xxx'
      peer_vm_cluster_id: 'ocid1.cloudvmcluster.oc1.eu-frankfurt-1.antheljttranicialfmioselrne6nd3ohrlcdqwytdukmdgkmkv3pjmi7hcq'
      peer_db_home_id: 'ocid1.dbhome.oc1.eu-frankfurt-1.antheljtqig3rgia3k6acqkoir6juxlfrz3igoakuhgan3gc5fzzdnshywbq'
      is_active_data_guard_enabled: false
      config_profile_name: ODAA02
      region: 'eu-frankfurt-1'
      protection_mode: MAXIMUM_PERFORMANCE  # required
      transport_type: ASYNC  # required
    register: a

- debug: var=a

** Here is the oci cli command that succeeds**

rob_wagner@cloudshell:~ (eu-frankfurt-1)$ cat database.json 
{
  "databaseAdminPassword": "xxx",
  "isActiveDataGuardEnabled": false,
  "protectionMode": "MAXIMUM_PERFORMANCE",
  "sourceDatabaseId": "ocid1.database.oc1.eu-frankfurt-1.antheljrtranicia2az2bpcl4pvwlyxxru2ov3d6vfnjgbklfglndq2nbrpa",
  "sourceTdeWalletPassword": "yyy",
  "transportType": "ASYNC"
}

rob_wagner@cloudshell:~ (eu-frankfurt-1)$ oci db database create-database-create-stand-by-database-details --database file://database.json --db-home-id ocid1.dbhome.oc1.eu-frankfurt-1.antheljtqig3rgia3k6acqkoir6juxlfrz3igoakuhgan3gc5fzzdnshywbq
{
  "data": {
    "character-set": "AL32UTF8",
    "compartment-id": "ocid1.compartment.oc1..aaaaaaaa47zilgtuiwgywkeizcloawnap4y3keanywt3x6x6uaq7erp4shha",
    "connection-strings": null,
    "data-guard-group": {
      "members": [
        {
          "apply-lag": null,
          "apply-rate": null,
          "database-id": "ocid1.database.oc1.eu-frankfurt-1.antheljrtranicia2az2bpcl4pvwlyxxru2ov3d6vfnjgbklfglndq2nbrpa",
          "db-system-id": "ocid1.cloudvmcluster.oc1.eu-frankfurt-1.antheljrtraniciafh7koiy2hssjtnctfhnhhbdige72bshviirzgamzeoea",
          "is-active-data-guard-enabled": null,
          "role": "PRIMARY",
          "transport-lag": null,
          "transport-lag-refresh": null,
          "transport-type": "ASYNC"
        },
        {
          "apply-lag": null,
          "apply-rate": null,
          "database-id": "ocid1.database.oc1.eu-frankfurt-1.antheljttranicia233vr2agbrffmb6qk42ary5kpluvxc5mc25m3tej2efq",
          "db-system-id": "ocid1.cloudvmcluster.oc1.eu-frankfurt-1.antheljttranicialfmioselrne6nd3ohrlcdqwytdukmdgkmkv3pjmi7hcq",
          "is-active-data-guard-enabled": false,
          "role": "STANDBY",
          "transport-lag": null,
          "transport-lag-refresh": null,
          "transport-type": "ASYNC"
        }
      ],
      "protection-mode": "MAXIMUM_PERFORMANCE"
    },
    "database-management-config": null,
    "database-software-image-id": null,
    "db-backup-config": null,
    "db-home-id": "ocid1.dbhome.oc1.eu-frankfurt-1.antheljtqig3rgia3k6acqkoir6juxlfrz3igoakuhgan3gc5fzzdnshywbq",
    "db-name": "rowagnc1",
    "db-system-id": null,
    "db-unique-name": "rowagnc1_cfj_fra",
    "db-workload": "OLTP",
    "defined-tags": {
      "Oracle-Tags": {
        "CreatedBy": "default/rob.wagner@sas.com",
        "CreatedOn": "2025-05-08T14:19:46.381Z"
      }
    },
    "encryption-key-location-details": null,
    "freeform-tags": {},
    "id": "ocid1.database.oc1.eu-frankfurt-1.antheljttranicia233vr2agbrffmb6qk42ary5kpluvxc5mc25m3tej2efq",
    "is-cdb": null,
    "key-store-id": null,
    "key-store-wallet-name": null,
    "kms-key-id": null,
    "kms-key-version-id": null,
    "last-backup-duration-in-seconds": null,
    "last-backup-timestamp": null,
    "last-failed-backup-timestamp": null,
    "lifecycle-details": null,
    "lifecycle-state": "PROVISIONING",
    "ncharacter-set": "AL16UTF16",
    "pdb-name": null,
    "sid-prefix": "rowagnc1",
    "source-database-point-in-time-recovery-timestamp": null,
    "time-created": "2025-05-08T14:19:46.488000+00:00",
    "vault-id": null,
    "vm-cluster-id": "ocid1.cloudvmcluster.oc1.eu-frankfurt-1.antheljttranicialfmioselrne6nd3ohrlcdqwytdukmdgkmkv3pjmi7hcq"
  },
  "etag": "e3bbe36",
  "opc-work-request-id": "ocid1.coreservicesworkrequest.oc1.eu-frankfurt-1.abtheljtk2idyowf4dw45aovwlqvdvc6zdfw4uf6u4cuivnr4ynx5cbxrmfa"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions