oracle / oracle.oci / 5.0.0 / module / oci_database_migration_connection Manage a Connection resource in Oracle Cloud Infrastructure | "added in version" 2.9.0 of oracle.oci" Authors: Oracle (@oracle) preview | supported by communityoracle.oci.oci_database_migration_connection (5.0.0) — module
Install with ansible-galaxy collection install oracle.oci:==5.0.0
collections: - name: oracle.oci version: 5.0.0
This module allows the user to create, update and delete a Connection resource in Oracle Cloud Infrastructure
For I(state=present), create a Database Connection resource that contains the details to connect to either a Source or Target Database in the migration.
This resource has the following action operations in the M(oracle.oci.oci_database_migration_connection_actions) module: change_compartment, connection_diagnostics.
- name: Create connection oci_database_migration_connection: # required compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx" database_type: MANUAL admin_credentials: # optional username: username_example password: example-password vault_details: # optional compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx" vault_id: "ocid1.vault.oc1..xxxxxxEXAMPLExxxxxx" key_id: "ocid1.key.oc1..xxxxxxEXAMPLExxxxxx" # optional manual_database_sub_type: ORACLE display_name: display_name_example database_id: "ocid1.database.oc1..xxxxxxEXAMPLExxxxxx" connect_descriptor: # optional host: host_example port: 56 database_service_name: database_service_name_example connect_string: connect_string_example certificate_tdn: certificate_tdn_example tls_wallet: tls_wallet_example tls_keystore: tls_keystore_example ssh_details: # optional host: host_example sshkey: sshkey_example user: user_example sudo_location: sudo_location_example replication_credentials: # optional username: username_example password: example-password private_endpoint: # optional compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx" vcn_id: "ocid1.vcn.oc1..xxxxxxEXAMPLExxxxxx" subnet_id: "ocid1.subnet.oc1..xxxxxxEXAMPLExxxxxx" freeform_tags: {'Department': 'Finance'} defined_tags: {'Operations': {'CostCenter': 'US'}} nsg_ids: [ "nsg_ids_example" ]
- name: Update connection oci_database_migration_connection: # required connection_id: "ocid1.connection.oc1..xxxxxxEXAMPLExxxxxx" # optional display_name: display_name_example database_id: "ocid1.database.oc1..xxxxxxEXAMPLExxxxxx" connect_descriptor: # optional host: host_example port: 56 database_service_name: database_service_name_example connect_string: connect_string_example certificate_tdn: certificate_tdn_example tls_wallet: tls_wallet_example tls_keystore: tls_keystore_example ssh_details: # optional host: host_example sshkey: sshkey_example user: user_example sudo_location: sudo_location_example admin_credentials: # optional username: username_example password: example-password replication_credentials: # optional username: username_example password: example-password private_endpoint: # optional compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx" vcn_id: "ocid1.vcn.oc1..xxxxxxEXAMPLExxxxxx" subnet_id: "ocid1.subnet.oc1..xxxxxxEXAMPLExxxxxx" vault_details: # optional compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx" vault_id: "ocid1.vault.oc1..xxxxxxEXAMPLExxxxxx" key_id: "ocid1.key.oc1..xxxxxxEXAMPLExxxxxx" freeform_tags: {'Department': 'Finance'} defined_tags: {'Operations': {'CostCenter': 'US'}} nsg_ids: [ "nsg_ids_example" ]
- name: Update connection using name (when environment variable OCI_USE_NAME_AS_IDENTIFIER is set) oci_database_migration_connection: # required compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx" display_name: display_name_example # optional database_id: "ocid1.database.oc1..xxxxxxEXAMPLExxxxxx" connect_descriptor: # optional host: host_example port: 56 database_service_name: database_service_name_example connect_string: connect_string_example certificate_tdn: certificate_tdn_example tls_wallet: tls_wallet_example tls_keystore: tls_keystore_example ssh_details: # optional host: host_example sshkey: sshkey_example user: user_example sudo_location: sudo_location_example admin_credentials: # optional username: username_example password: example-password replication_credentials: # optional username: username_example password: example-password private_endpoint: # optional compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx" vcn_id: "ocid1.vcn.oc1..xxxxxxEXAMPLExxxxxx" subnet_id: "ocid1.subnet.oc1..xxxxxxEXAMPLExxxxxx" vault_details: # optional compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx" vault_id: "ocid1.vault.oc1..xxxxxxEXAMPLExxxxxx" key_id: "ocid1.key.oc1..xxxxxxEXAMPLExxxxxx" freeform_tags: {'Department': 'Finance'} defined_tags: {'Operations': {'CostCenter': 'US'}} nsg_ids: [ "nsg_ids_example" ]
- name: Delete connection oci_database_migration_connection: # required connection_id: "ocid1.connection.oc1..xxxxxxEXAMPLExxxxxx" state: absent
- name: Delete connection using name (when environment variable OCI_USE_NAME_AS_IDENTIFIER is set) oci_database_migration_connection: # required compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx" display_name: display_name_example state: absent
wait: default: true description: Whether to wait for create or delete operation to complete. type: bool state: choices: - present - absent default: present description: - The state of the Connection. - Use I(state=present) to create or update a Connection. - Use I(state=absent) to delete a Connection. required: false type: str key_by: description: The list of attributes of this resource which should be used to uniquely identify an instance of the resource. By default, all the attributes of a resource are used to uniquely identify a resource. elements: str type: list region: description: - The Oracle Cloud Infrastructure region to use for all OCI API requests. If not set, then the value of the OCI_REGION variable, if any, is used. This option is required if the region is not specified through a configuration file (See C(config_file_location)). Please refer to U(https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm) for more information on OCI regions. type: str nsg_ids: description: - An array of Network Security Group OCIDs used to define network access for Connections. - This parameter is updatable. elements: str type: list tenancy: description: - OCID of your tenancy. If not set, then the value of the OCI_TENANCY variable, if any, is used. This option is required if the tenancy OCID is not specified through a configuration file (See C(config_file_location)). To get the tenancy OCID, please refer U(https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm) type: str api_user: description: - The OCID of the user, on whose behalf, OCI APIs are invoked. If not set, then the value of the OCI_USER_ID environment variable, if any, is used. This option is required if the user is not specified through a configuration file (See C(config_file_location)). To get the user's OCID, please refer U(https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm). type: str auth_type: choices: - api_key - instance_principal - instance_obo_user - resource_principal - security_token default: api_key description: - The type of authentication to use for making API requests. By default C(auth_type="api_key") based authentication is performed and the API key (see I(api_user_key_file)) in your config file will be used. If this 'auth_type' module option is not specified, the value of the OCI_ANSIBLE_AUTH_TYPE, if any, is used. Use C(auth_type="instance_principal") to use instance principal based authentication when running ansible playbooks within an OCI compute instance. type: str tls_wallet: description: - cwallet.sso containing containing the TCPS/SSL certificate; base64 encoded String. Not required for source container database connections. - This parameter is updatable. type: str cert_bundle: description: - The full path to a CA certificate bundle to be used for SSL verification. This will override the default CA certificate bundle. If not set, then the value of the OCI_ANSIBLE_CERT_BUNDLE variable, if any, is used. type: str database_id: description: - The OCID of the cloud database. Required if the database connection type is Autonomous. - This parameter is updatable. type: str ssh_details: description: - '' - This parameter is updatable. suboptions: host: description: - Name of the host the SSH key is valid for. - This parameter is updatable. type: str sshkey: description: - Private SSH key string. - This parameter is updatable. type: str sudo_location: description: - Sudo location - This parameter is updatable. type: str user: description: - SSH user - This parameter is updatable. type: str type: dict auth_purpose: choices: - service_principal description: - The auth purpose which can be used in conjunction with 'auth_type=instance_principal'. The default auth_purpose for instance_principal is None. type: str defined_tags: description: - 'Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace": {"bar-key": "value"}}`' - This parameter is updatable. type: dict display_name: aliases: - name description: - Database Connection display name identifier. - Required for create, update, delete when environment variable C(OCI_USE_NAME_AS_IDENTIFIER) is set. - This parameter is updatable when C(OCI_USE_NAME_AS_IDENTIFIER) is not set. type: str force_create: default: false description: Whether to attempt non-idempotent creation of a resource. By default, create resource is an idempotent operation, and doesn't create the resource if it already exists. Setting this option to true, forcefully creates a copy of the resource, even if it already exists.This option is mutually exclusive with I(key_by). type: bool tls_keystore: description: - keystore.jks file contents; base64 encoded String. Requires a TLS wallet to be specified. Not required for source container database connections. - This parameter is updatable. type: str wait_timeout: description: Time, in seconds, to wait when I(wait=yes). Defaults to 1200 for most of the services but some services might have a longer wait timeout. type: int connection_id: aliases: - id description: - The OCID of the database connection - Required for update using I(state=present) when environment variable C(OCI_USE_NAME_AS_IDENTIFIER) is not set. - Required for delete using I(state=absent) when environment variable C(OCI_USE_NAME_AS_IDENTIFIER) is not set. type: str database_type: choices: - MANUAL - AUTONOMOUS - USER_MANAGED_OCI description: - Database connection type. - Required for create using I(state=present). type: str freeform_tags: description: - 'Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`' - This parameter is updatable. type: dict vault_details: description: - '' - Required for create using I(state=present). - This parameter is updatable. suboptions: compartment_id: description: - OCID of the compartment where the secret containing the credentials will be created. - This parameter is updatable. type: str key_id: description: - OCID of the vault encryption key - This parameter is updatable. type: str vault_id: description: - OCID of the vault - This parameter is updatable. type: str type: dict compartment_id: description: - OCID of the compartment - Required for create using I(state=present). - Required for update when environment variable C(OCI_USE_NAME_AS_IDENTIFIER) is set. - Required for delete when environment variable C(OCI_USE_NAME_AS_IDENTIFIER) is set. type: str certificate_tdn: description: - This name is the distinguished name used while creating the certificate on target database. Requires a TLS wallet to be specified. Not required for source container database connections. - This parameter is updatable. type: str private_endpoint: description: - '' - This parameter is updatable. suboptions: compartment_id: description: - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to contain the private endpoint. - This parameter is updatable. type: str subnet_id: description: - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the customer's subnet where the private endpoint VNIC will reside. - This parameter is updatable. type: str vcn_id: description: - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN where the Private Endpoint will be bound to. - This parameter is updatable. type: str type: dict admin_credentials: description: - '' - Required for create using I(state=present). - This parameter is updatable. suboptions: password: description: - Administrator password - This parameter is updatable. type: str username: description: - Administrator username - This parameter is updatable. type: str type: dict api_user_key_file: description: - Full path and filename of the private key (in PEM format). If not set, then the value of the OCI_USER_KEY_FILE variable, if any, is used. This option is required if the private key is not specified through a configuration file (See C(config_file_location)). If the key is encrypted with a pass-phrase, the C(api_user_key_pass_phrase) option must also be provided. type: str connect_descriptor: description: - '' - This parameter is updatable. suboptions: connect_string: description: - 'Connect String. Required if no host, port nor databaseServiceName were specified. If a Private Endpoint was specified in the Connection, the host entry should be a valid IP address. Supported formats: Easy connect: <host>:<port>/<db_service_name> Long format: (description= (address=(port=<port>)(host=<host>))(connect_data=(service_name=<db_service_name>)))' - This parameter is updatable. type: str database_service_name: description: - Database service name. Required if no connectString was specified. - This parameter is updatable. type: str host: description: - Host or IP address of the connect descriptor. Required if no connectString was specified. - This parameter is updatable. type: str port: description: - Port of the connect descriptor. Required if no connectString was specified. - This parameter is updatable. type: int type: dict config_profile_name: description: - The profile to load from the config file referenced by C(config_file_location). If not set, then the value of the OCI_CONFIG_PROFILE environment variable, if any, is used. Otherwise, defaults to the "DEFAULT" profile in C(config_file_location). type: str api_user_fingerprint: description: - Fingerprint for the key pair being used. If not set, then the value of the OCI_USER_FINGERPRINT environment variable, if any, is used. This option is required if the key fingerprint is not specified through a configuration file (See C(config_file_location)). To get the key pair's fingerprint value please refer U(https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm). type: str config_file_location: description: - Path to configuration file. If not set then the value of the OCI_CONFIG_FILE environment variable, if any, is used. Otherwise, defaults to ~/.oci/config. type: str replication_credentials: description: - '' - This parameter is updatable. suboptions: password: description: - Administrator password - This parameter is updatable. type: str username: description: - Administrator username - This parameter is updatable. type: str type: dict api_user_key_pass_phrase: description: - Passphrase used by the key referenced in C(api_user_key_file), if it is encrypted. If not set, then the value of the OCI_USER_KEY_PASS_PHRASE variable, if any, is used. This option is required if the key passphrase is not specified through a configuration file (See C(config_file_location)). type: str manual_database_sub_type: choices: - ORACLE - RDS_ORACLE description: - Database manual connection subtype. This value can only be specified for manual connections. type: str realm_specific_endpoint_template_enabled: description: - Enable/Disable realm specific endpoint template for service client. By Default, realm specific endpoint template is disabled. If not set, then the value of the OCI_REALM_SPECIFIC_SERVICE_ENDPOINT_TEMPLATE_ENABLED variable, if any, is used. type: bool
connection: contains: admin_credentials: contains: username: description: - Administrator username returned: on success sample: username_example type: str description: - '' returned: on success type: complex certificate_tdn: description: - This name is the distinguished name used while creating the certificate on target database. returned: on success sample: certificate_tdn_example type: str compartment_id: description: - OCID of the compartment returned: on success sample: ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx type: str connect_descriptor: contains: connect_string: description: - Connect string. returned: on success sample: connect_string_example type: str database_service_name: description: - Database service name. returned: on success sample: database_service_name_example type: str host: description: - Host of the connect descriptor. returned: on success sample: host_example type: str port: description: - Port of the connect descriptor. returned: on success sample: 56 type: int description: - '' returned: on success type: complex credentials_secret_id: description: - OCID of the Secret in the OCI vault containing the Database Connection credentials. returned: on success sample: ocid1.credentialssecret.oc1..xxxxxxEXAMPLExxxxxx type: str database_id: description: - The OCID of the cloud database. returned: on success sample: ocid1.database.oc1..xxxxxxEXAMPLExxxxxx type: str database_type: description: - Database connection type. returned: on success sample: MANUAL type: str defined_tags: description: - 'Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace": {"bar-key": "value"}}`' returned: on success sample: Operations: CostCenter: US type: dict display_name: description: - Database Connection display name identifier. returned: on success sample: display_name_example type: str freeform_tags: description: - 'Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`' returned: on success sample: Department: Finance type: dict id: description: - The OCID of the resource returned: on success sample: ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx type: str is_dedicated: description: - True if the Autonomous Connection is dedicated. Not provided for Non-Autonomous Connections. returned: on success sample: true type: bool lifecycle_details: description: - A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state. returned: on success sample: lifecycle_details_example type: str lifecycle_state: description: - The current state of the Connection resource. returned: on success sample: CREATING type: str manual_database_sub_type: description: - Database manual connection subtype. This value can only be specified for manual connections. returned: on success sample: ORACLE type: str nsg_ids: description: - An array of Network Security Group OCIDs used to define network access for Connections. returned: on success sample: [] type: list private_endpoint: contains: compartment_id: description: - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to contain the private endpoint. returned: on success sample: ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx type: str id: description: - L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of a previously created Private Endpoint. returned: on success sample: ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx type: str subnet_id: description: - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the customer's subnet where the private endpoint VNIC will reside. returned: on success sample: ocid1.subnet.oc1..xxxxxxEXAMPLExxxxxx type: str vcn_id: description: - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN where the Private Endpoint will be bound to. returned: on success sample: ocid1.vcn.oc1..xxxxxxEXAMPLExxxxxx type: str description: - '' returned: on success type: complex replication_credentials: contains: username: description: - Administrator username returned: on success sample: username_example type: str description: - '' returned: on success type: complex ssh_details: contains: host: description: - Name of the host the SSH key is valid for. returned: on success sample: host_example type: str sudo_location: description: - Sudo location returned: on success sample: sudo_location_example type: str user: description: - SSH user returned: on success sample: user_example type: str description: - '' returned: on success type: complex system_tags: description: - 'Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud": {"free-tier-retained": "true"}}`' returned: on success sample: {} type: dict time_created: description: - The time the Connection resource was created. An RFC3339 formatted datetime string. returned: on success sample: '2013-10-20T19:20:30+01:00' type: str time_updated: description: - The time of the last Connection resource details update. An RFC3339 formatted datetime string. returned: on success sample: '2013-10-20T19:20:30+01:00' type: str vault_details: contains: compartment_id: description: - OCID of the compartment where the secret containing the credentials will be created. returned: on success sample: ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx type: str key_id: description: - OCID of the vault encryption key returned: on success sample: ocid1.key.oc1..xxxxxxEXAMPLExxxxxx type: str vault_id: description: - OCID of the vault returned: on success sample: ocid1.vault.oc1..xxxxxxEXAMPLExxxxxx type: str description: - '' returned: on success type: complex description: - Details of the Connection resource acted upon by the current operation returned: on success sample: admin_credentials: username: username_example certificate_tdn: certificate_tdn_example compartment_id: ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx connect_descriptor: connect_string: connect_string_example database_service_name: database_service_name_example host: host_example port: 56 credentials_secret_id: ocid1.credentialssecret.oc1..xxxxxxEXAMPLExxxxxx database_id: ocid1.database.oc1..xxxxxxEXAMPLExxxxxx database_type: MANUAL defined_tags: Operations: CostCenter: US display_name: display_name_example freeform_tags: Department: Finance id: ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx is_dedicated: true lifecycle_details: lifecycle_details_example lifecycle_state: CREATING manual_database_sub_type: ORACLE nsg_ids: [] private_endpoint: compartment_id: ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx id: ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx subnet_id: ocid1.subnet.oc1..xxxxxxEXAMPLExxxxxx vcn_id: ocid1.vcn.oc1..xxxxxxEXAMPLExxxxxx replication_credentials: username: username_example ssh_details: host: host_example sudo_location: sudo_location_example user: user_example system_tags: {} time_created: '2013-10-20T19:20:30+01:00' time_updated: '2013-10-20T19:20:30+01:00' vault_details: compartment_id: ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx key_id: ocid1.key.oc1..xxxxxxEXAMPLExxxxxx vault_id: ocid1.vault.oc1..xxxxxxEXAMPLExxxxxx type: complex