oracle.oci.oci_database_db_node_actions (5.0.0) — module

Perform actions on a DbNode resource in Oracle Cloud Infrastructure

| "added in version" 2.9.0 of oracle.oci"

Authors: Oracle (@oracle)

preview | supported by community

Install collection

Install with ansible-galaxy collection install oracle.oci:==5.0.0


Add to requirements.yml

  collections:
    - name: oracle.oci
      version: 5.0.0

Description

Perform actions on a DbNode resource in Oracle Cloud Infrastructure

For I(action=db_node_action), performs one of the following power actions on the specified DB node: - start - power on - stop - power off - softreset - ACPI shutdown and power on - reset - power off and power on

**Note:** Stopping a node affects billing differently, depending on the type of DB system: *Bare metal and Exadata systems* - The _stop_ state has no effect on the resources you consume. Billing continues for DB nodes that you stop, and related resources continue to apply against any relevant quotas. You must terminate the DB system (L(TerminateDbSystem,https://docs.cloud.oracle.com/en-us/iaas/api/#/en/database/latest/DbSystem/TerminateDbSystem)) to remove its resources from billing and quotas. *Virtual machine DB systems* - Stopping a node stops billing for all OCPUs associated with that node, and billing resumes when you restart the node.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Perform action stop on db_node
  oci_database_db_node_actions:
    # required
    db_node_id: "ocid1.dbnode.oc1..xxxxxxEXAMPLExxxxxx"
    action: STOP
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Perform action start on db_node
  oci_database_db_node_actions:
    # required
    db_node_id: "ocid1.dbnode.oc1..xxxxxxEXAMPLExxxxxx"
    action: STOP
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Perform action softreset on db_node
  oci_database_db_node_actions:
    # required
    db_node_id: "ocid1.dbnode.oc1..xxxxxxEXAMPLExxxxxx"
    action: STOP
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Perform action reset on db_node
  oci_database_db_node_actions:
    # required
    db_node_id: "ocid1.dbnode.oc1..xxxxxxEXAMPLExxxxxx"
    action: STOP

Inputs

    
wait:
    default: true
    description: Whether to wait for create or delete operation to complete.
    type: bool

action:
    choices:
    - stop
    - start
    - softreset
    - reset
    description:
    - The action to perform on the DB Node.
    required: true
    type: str

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

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

db_node_id:
    aliases:
    - id
    description:
    - The database node L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm).
    required: true
    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

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

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

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

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

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

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

Outputs

db_node:
  contains:
    additional_details:
      description:
      - Additional information about the planned maintenance.
      returned: on success
      sample: additional_details_example
      type: str
    backup_ip_id:
      description:
      - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)
        of the backup IP address associated with the database node. Use this OCID
        with either the L(GetPrivateIp,https://docs.cloud.oracle.com/en-us/iaas/api/#/en/iaas/20160918/PrivateIp/GetPrivateIp)
        or the L(GetPublicIpByPrivateIpId,https://docs.cloud.oracle.com/en-us/iaas/api/#/en/iaas/20160918/PublicIp/GetPublicIpByPrivateIpId)
        API to get the IP address needed to make a database connection.
      - '**Note:** Applies only to Exadata Cloud Service.'
      returned: on success
      sample: ocid1.backupip.oc1..xxxxxxEXAMPLExxxxxx
      type: str
    backup_vnic2_id:
      description:
      - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)
        of the second backup VNIC.
      - '**Note:** Applies only to Exadata Cloud Service.'
      returned: on success
      sample: ocid1.backupvnic2.oc1..xxxxxxEXAMPLExxxxxx
      type: str
    backup_vnic_id:
      description:
      - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)
        of the backup VNIC.
      returned: on success
      sample: ocid1.backupvnic.oc1..xxxxxxEXAMPLExxxxxx
      type: str
    cpu_core_count:
      description:
      - The number of CPU cores enabled on the Db node.
      returned: on success
      sample: 56
      type: int
    db_node_storage_size_in_gbs:
      description:
      - The allocated local node storage in GBs on the Db node.
      returned: on success
      sample: 56
      type: int
    db_server_id:
      description:
      - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)
        of the Exacc Db server associated with the database node.
      returned: on success
      sample: ocid1.dbserver.oc1..xxxxxxEXAMPLExxxxxx
      type: str
    db_system_id:
      description:
      - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)
        of the DB system.
      returned: on success
      sample: ocid1.dbsystem.oc1..xxxxxxEXAMPLExxxxxx
      type: str
    fault_domain:
      description:
      - The name of the Fault Domain the instance is contained in.
      returned: on success
      sample: FAULT-DOMAIN-1
      type: str
    host_ip_id:
      description:
      - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)
        of the host IP address associated with the database node. Use this OCID with
        either the L(GetPrivateIp,https://docs.cloud.oracle.com/en-us/iaas/api/#/en/iaas/20160918/PrivateIp/GetPrivateIp)
        or the L(GetPublicIpByPrivateIpId,https://docs.cloud.oracle.com/en-us/iaas/api/#/en/iaas/20160918/PublicIp/GetPublicIpByPrivateIpId)
        API to get the IP address needed to make a database connection.
      - '**Note:** Applies only to Exadata Cloud Service.'
      returned: on success
      sample: ocid1.hostip.oc1..xxxxxxEXAMPLExxxxxx
      type: str
    hostname:
      description:
      - The host name for the database node.
      returned: on success
      sample: hostname_example
      type: str
    id:
      description:
      - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)
        of the database node.
      returned: on success
      sample: ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx
      type: str
    lifecycle_state:
      description:
      - The current state of the database node.
      returned: on success
      sample: PROVISIONING
      type: str
    maintenance_type:
      description:
      - The type of database node maintenance.
      returned: on success
      sample: VMDB_REBOOT_MIGRATION
      type: str
    memory_size_in_gbs:
      description:
      - The allocated memory in GBs on the Db node.
      returned: on success
      sample: 56
      type: int
    software_storage_size_in_gb:
      description:
      - The size (in GB) of the block storage volume allocation for the DB system.
        This attribute applies only for virtual machine DB systems.
      returned: on success
      sample: 56
      type: int
    time_created:
      description:
      - The date and time that the database node was created.
      returned: on success
      sample: '2013-10-20T19:20:30+01:00'
      type: str
    time_maintenance_window_end:
      description:
      - End date and time of maintenance window.
      returned: on success
      sample: '2013-10-20T19:20:30+01:00'
      type: str
    time_maintenance_window_start:
      description:
      - Start date and time of maintenance window.
      returned: on success
      sample: '2013-10-20T19:20:30+01:00'
      type: str
    vnic2_id:
      description:
      - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)
        of the second VNIC.
      - '**Note:** Applies only to Exadata Cloud Service.'
      returned: on success
      sample: ocid1.vnic2.oc1..xxxxxxEXAMPLExxxxxx
      type: str
    vnic_id:
      description:
      - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)
        of the VNIC.
      returned: on success
      sample: ocid1.vnic.oc1..xxxxxxEXAMPLExxxxxx
      type: str
  description:
  - Details of the DbNode resource acted upon by the current operation
  returned: on success
  sample:
    additional_details: additional_details_example
    backup_ip_id: ocid1.backupip.oc1..xxxxxxEXAMPLExxxxxx
    backup_vnic2_id: ocid1.backupvnic2.oc1..xxxxxxEXAMPLExxxxxx
    backup_vnic_id: ocid1.backupvnic.oc1..xxxxxxEXAMPLExxxxxx
    cpu_core_count: 56
    db_node_storage_size_in_gbs: 56
    db_server_id: ocid1.dbserver.oc1..xxxxxxEXAMPLExxxxxx
    db_system_id: ocid1.dbsystem.oc1..xxxxxxEXAMPLExxxxxx
    fault_domain: FAULT-DOMAIN-1
    host_ip_id: ocid1.hostip.oc1..xxxxxxEXAMPLExxxxxx
    hostname: hostname_example
    id: ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx
    lifecycle_state: PROVISIONING
    maintenance_type: VMDB_REBOOT_MIGRATION
    memory_size_in_gbs: 56
    software_storage_size_in_gb: 56
    time_created: '2013-10-20T19:20:30+01:00'
    time_maintenance_window_end: '2013-10-20T19:20:30+01:00'
    time_maintenance_window_start: '2013-10-20T19:20:30+01:00'
    vnic2_id: ocid1.vnic2.oc1..xxxxxxEXAMPLExxxxxx
    vnic_id: ocid1.vnic.oc1..xxxxxxEXAMPLExxxxxx
  type: complex