oracle.oci.oci_cloud_bridge_asset_actions – Perform actions on an Asset resource in Oracle Cloud Infrastructure¶
Note
This plugin is part of the oracle.oci collection (version 5.2.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install oracle.oci
.
To use it in a playbook, specify: oracle.oci.oci_cloud_bridge_asset_actions
.
New in version 2.9.0: of oracle.oci
Synopsis¶
Perform actions on an Asset resource in Oracle Cloud Infrastructure
For action=change_compartment, moves an asset resource from one compartment to another. When provided, If-Match is checked against ETag values of the resource.
For action=change_asset_tags, change an asset’s tag.
Requirements¶
The below requirements are needed on the host that executes this module.
python >= 3.6
Python SDK for Oracle Cloud Infrastructure https://oracle-cloud-infrastructure-python-sdk.readthedocs.io
Parameters¶
Parameter | Choices/Defaults | Comments |
---|---|---|
action
string
/ required
|
|
The action to perform on the Asset.
|
api_user
string
|
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
config_file_location ). To get the user's OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm. |
|
api_user_fingerprint
string
|
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
config_file_location ). To get the key pair's fingerprint value please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm. |
|
api_user_key_file
string
|
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
config_file_location ). If the key is encrypted with a pass-phrase, the api_user_key_pass_phrase option must also be provided. |
|
api_user_key_pass_phrase
string
|
Passphrase used by the key referenced in
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 config_file_location ). |
|
asset_id
string
/ required
|
Unique asset identifier.
aliases: id |
|
auth_purpose
string
|
|
The auth purpose which can be used in conjunction with 'auth_type=instance_principal'. The default auth_purpose for instance_principal is None.
|
auth_type
string
|
|
The type of authentication to use for making API requests. By default
auth_type="api_key" based authentication is performed and the API key (see 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 auth_type="instance_principal" to use instance principal based authentication when running ansible playbooks within an OCI compute instance. |
cert_bundle
string
|
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.
|
|
compartment_id
string
|
The OCID of the compartment into which the resource should be moved.
Required for action=change_compartment.
|
|
config_file_location
string
|
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.
|
|
config_profile_name
string
|
The profile to load from the config file referenced by
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 config_file_location . |
|
defined_tags
dictionary
|
The defined tags associated with this resource, if any. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example: `{"Operations": {"CostCenter": "42"}}`
Applicable only for action=change_asset_tags.
|
|
freeform_tags
dictionary
|
The freeform tags associated with this resource, if any. Each tag is a simple key-value pair with no predefined name, type, or namespace/scope. For more information, see Resource Tags. Example: `{"Department": "Finance"}`
Applicable only for action=change_asset_tags.
|
|
realm_specific_endpoint_template_enabled
boolean
|
|
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.
|
region
string
|
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
config_file_location ). Please refer to https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm for more information on OCI regions. |
|
tenancy
string
|
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
config_file_location ). To get the tenancy OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm |
|
wait
boolean
|
|
Whether to wait for create or delete operation to complete.
|
wait_timeout
integer
|
Time, in seconds, to wait when wait=yes. Defaults to 1200 for most of the services but some services might have a longer wait timeout.
|
Notes¶
Note
For OCI python sdk configuration, please refer to https://oracle-cloud-infrastructure-python-sdk.readthedocs.io/en/latest/configuration.html
Examples¶
- name: Perform action change_compartment on asset
oci_cloud_bridge_asset_actions:
# required
compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"
asset_id: "ocid1.asset.oc1..xxxxxxEXAMPLExxxxxx"
action: change_compartment
- name: Perform action change_asset_tags on asset
oci_cloud_bridge_asset_actions:
# required
asset_id: "ocid1.asset.oc1..xxxxxxEXAMPLExxxxxx"
action: change_asset_tags
# optional
freeform_tags: {'Department': 'Finance'}
defined_tags: {'Operations': {'CostCenter': 'US'}}
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description | |||
---|---|---|---|---|---|
asset
complex
|
on success |
Details of the Asset resource acted upon by the current operation
Sample:
{'asset_source_ids': [], 'asset_type': 'VMWARE_VM', 'compartment_id': 'ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx', 'compute': {'connected_networks': 56, 'cores_count': 56, 'cpu_model': 'cpu_model_example', 'description': 'description_example', 'disks': [{'boot_order': 56, 'location': 'location_example', 'name': 'name_example', 'persistent_mode': 'persistent_mode_example', 'size_in_mbs': 56, 'uuid': 'uuid_example', 'uuid_lun': 'uuid_lun_example'}], 'disks_count': 56, 'dns_name': 'dns_name_example', 'firmware': 'firmware_example', 'gpu_devices': [{'cores_count': 56, 'description': 'description_example', 'manufacturer': 'manufacturer_example', 'memory_in_mbs': 56, 'name': 'name_example'}], 'gpu_devices_count': 56, 'guest_state': 'guest_state_example', 'hardware_version': 'hardware_version_example', 'host_name': 'host_name_example', 'is_pmem_enabled': True, 'is_tpm_enabled': True, 'latency_sensitivity': 'latency_sensitivity_example', 'memory_in_mbs': 56, 'nics': [{'ip_addresses': [], 'label': 'label_example', 'mac_address': 'mac_address_example', 'mac_address_type': 'mac_address_type_example', 'network_name': 'network_name_example', 'switch_name': 'switch_name_example'}], 'nics_count': 56, 'nvdimm_controller': {'bus_number': 56, 'label': 'label_example'}, 'nvdimms': [{'controller_key': 56, 'label': 'label_example', 'unit_number': 56}], 'operating_system': 'operating_system_example', 'operating_system_version': 'operating_system_version_example', 'pmem_in_mbs': 56, 'power_state': 'power_state_example', 'primary_ip': 'primary_ip_example', 'scsi_controller': {'label': 'label_example', 'shared_bus': 'shared_bus_example', 'unit_number': 56}, 'storage_provisioned_in_mbs': 56, 'threads_per_core_count': 56}, 'defined_tags': {'Operations': {'CostCenter': 'US'}}, 'display_name': 'display_name_example', 'external_asset_key': 'external_asset_key_example', 'freeform_tags': {'Department': 'Finance'}, 'id': 'ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx', 'inventory_id': 'ocid1.inventory.oc1..xxxxxxEXAMPLExxxxxx', 'lifecycle_state': 'ACTIVE', 'source_key': 'source_key_example', 'system_tags': {}, 'time_created': '2013-10-20T19:20:30+01:00', 'time_updated': '2013-10-20T19:20:30+01:00', 'vm': {'hypervisor_host': 'hypervisor_host_example', 'hypervisor_vendor': 'hypervisor_vendor_example', 'hypervisor_version': 'hypervisor_version_example'}, 'vmware_v_center': {'data_center': 'data_center_example', 'vcenter_key': 'vcenter_key_example', 'vcenter_version': 'vcenter_version_example'}, 'vmware_vm': {'cluster': 'cluster_example', 'customer_fields': [], 'customer_tags': [{'description': 'description_example', 'name': 'name_example'}], 'fault_tolerance_bandwidth': 56, 'fault_tolerance_secondary_latency': 56, 'fault_tolerance_state': 'fault_tolerance_state_example', 'instance_uuid': 'instance_uuid_example', 'is_disks_cbt_enabled': True, 'is_disks_uuid_enabled': True, 'path': 'path_example', 'vmware_tools_status': 'vmware_tools_status_example'}}
|
|||
asset_source_ids
list
/ elements=string
|
on success |
List of asset source OCID.
|
|||
asset_type
string
|
on success |
The type of asset.
Sample:
VMWARE_VM
|
|||
compartment_id
string
|
on success |
The OCID of the compartment to which an asset belongs to.
Sample:
ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx
|
|||
compute
complex
|
on success |
|
|||
connected_networks
integer
|
on success |
Number of connected networks.
Sample:
56
|
|||
cores_count
integer
|
on success |
Number of CPUs.
Sample:
56
|
|||
cpu_model
string
|
on success |
CPU model name.
Sample:
cpu_model_example
|
|||
description
string
|
on success |
Information about the asset.
Sample:
description_example
|
|||
disks
complex
|
on success |
Lists the set of disks belonging to the virtual machine. This list is unordered.
|
|||
boot_order
integer
|
on success |
Order of boot volumes.
Sample:
56
|
|||
location
string
|
on success |
Location of the boot/data volume.
Sample:
location_example
|
|||
name
string
|
on success |
Disk name.
Sample:
name_example
|
|||
persistent_mode
string
|
on success |
The disk persistent mode.
Sample:
persistent_mode_example
|
|||
size_in_mbs
integer
|
on success |
The size of the volume in MBs.
Sample:
56
|
|||
uuid
string
|
on success |
Disk UUID for the virtual disk, if available.
Sample:
uuid_example
|
|||
uuid_lun
string
|
on success |
Disk UUID LUN for the virtual disk, if available.
Sample:
uuid_lun_example
|
|||
disks_count
integer
|
on success |
Number of disks.
Sample:
56
|
|||
dns_name
string
|
on success |
Fully Qualified DNS Name.
Sample:
dns_name_example
|
|||
firmware
string
|
on success |
Information about firmware type for this virtual machine.
Sample:
firmware_example
|
|||
gpu_devices
complex
|
on success |
List of GPU devices attached to a virtual machine.
|
|||
cores_count
integer
|
on success |
Number of GPU cores.
Sample:
56
|
|||
description
string
|
on success |
GPU device description.
Sample:
description_example
|
|||
manufacturer
string
|
on success |
The manufacturer of GPU.
Sample:
manufacturer_example
|
|||
memory_in_mbs
integer
|
on success |
GPU memory size in MBs.
Sample:
56
|
|||
name
string
|
on success |
GPU device name.
Sample:
name_example
|
|||
gpu_devices_count
integer
|
on success |
Number of GPU devices.
Sample:
56
|
|||
guest_state
string
|
on success |
Guest state.
Sample:
guest_state_example
|
|||
hardware_version
string
|
on success |
Hardware version.
Sample:
hardware_version_example
|
|||
host_name
string
|
on success |
Host name of the VM.
Sample:
host_name_example
|
|||
is_pmem_enabled
boolean
|
on success |
Whether Pmem is enabled. Decides if NVDIMMs are used as a permanent memory.
Sample:
True
|
|||
is_tpm_enabled
boolean
|
on success |
Whether Trusted Platform Module (TPM) is enabled.
Sample:
True
|
|||
latency_sensitivity
string
|
on success |
Latency sensitivity.
Sample:
latency_sensitivity_example
|
|||
memory_in_mbs
integer
|
on success |
Memory size in MBs.
Sample:
56
|
|||
nics
complex
|
on success |
List of network ethernet cards attached to a virtual machine.
|
|||
ip_addresses
list
/ elements=string
|
on success |
List of IP addresses.
|
|||
label
string
|
on success |
Provides a label and summary information for the device.
Sample:
label_example
|
|||
mac_address
string
|
on success |
Mac address of the VM.
Sample:
mac_address_example
|
|||
mac_address_type
string
|
on success |
Mac address type.
Sample:
mac_address_type_example
|
|||
network_name
string
|
on success |
Network name.
Sample:
network_name_example
|
|||
switch_name
string
|
on success |
Switch name.
Sample:
switch_name_example
|
|||
nics_count
integer
|
on success |
Number of network ethernet cards.
Sample:
56
|
|||
nvdimm_controller
complex
|
on success |
|
|||
bus_number
integer
|
on success |
Bus number.
Sample:
56
|
|||
label
string
|
on success |
Provides a label and summary information for the device.
Sample:
label_example
|
|||
nvdimms
complex
|
on success |
The properties of the NVDIMMs attached to a virtual machine.
|
|||
controller_key
integer
|
on success |
Controller key.
Sample:
56
|
|||
label
string
|
on success |
Provides a label and summary information for the device.
Sample:
label_example
|
|||
unit_number
integer
|
on success |
The unit number of NVDIMM.
Sample:
56
|
|||
operating_system
string
|
on success |
Operating system.
Sample:
operating_system_example
|
|||
operating_system_version
string
|
on success |
Operating system version.
Sample:
operating_system_version_example
|
|||
pmem_in_mbs
integer
|
on success |
Pmem size in MBs.
Sample:
56
|
|||
power_state
string
|
on success |
The current power state of the virtual machine.
Sample:
power_state_example
|
|||
primary_ip
string
|
on success |
Primary IP address of the compute instance.
Sample:
primary_ip_example
|
|||
scsi_controller
complex
|
on success |
|
|||
label
string
|
on success |
Provides a label and summary information for the device.
Sample:
label_example
|
|||
shared_bus
string
|
on success |
Shared bus.
Sample:
shared_bus_example
|
|||
unit_number
integer
|
on success |
The unit number of the SCSI controller.
Sample:
56
|
|||
storage_provisioned_in_mbs
integer
|
on success |
Provision storage size in MBs.
Sample:
56
|
|||
threads_per_core_count
integer
|
on success |
Number of threads per core.
Sample:
56
|
|||
defined_tags
dictionary
|
on success |
The defined tags associated with this resource, if any. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example: `{"Operations": {"CostCenter": "42"}}`
Sample:
{'Operations': {'CostCenter': 'US'}}
|
|||
display_name
string
|
on success |
Asset display name.
Sample:
display_name_example
|
|||
external_asset_key
string
|
on success |
The key of the asset from the external environment.
Sample:
external_asset_key_example
|
|||
freeform_tags
dictionary
|
on success |
The freeform tags associated with this resource, if any. Each tag is a simple key-value pair with no predefined name, type, or namespace/scope. For more information, see Resource Tags. Example: `{"Department": "Finance"}`
Sample:
{'Department': 'Finance'}
|
|||
id
string
|
on success |
Asset OCID that is immutable on creation.
Sample:
ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx
|
|||
inventory_id
string
|
on success |
Inventory ID to which an asset belongs to.
Sample:
ocid1.inventory.oc1..xxxxxxEXAMPLExxxxxx
|
|||
lifecycle_state
string
|
on success |
The current state of the asset.
Sample:
ACTIVE
|
|||
source_key
string
|
on success |
The source key that the asset belongs to.
Sample:
source_key_example
|
|||
system_tags
dictionary
|
on success |
The system tags associated with this resource, if any. The system tags are set by Oracle cloud infrastructure services. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example: `{orcl-cloud: {free-tier-retain: true}}`
|
|||
time_created
string
|
on success |
The time when the asset was created. An RFC3339 formatted datetime string.
Sample:
2013-10-20T19:20:30+01:00
|
|||
time_updated
string
|
on success |
The time when the asset was updated. An RFC3339 formatted datetime string.
Sample:
2013-10-20T19:20:30+01:00
|
|||
vm
complex
|
on success |
|
|||
hypervisor_host
string
|
on success |
Host name/IP address of VM on which the host is running.
Sample:
hypervisor_host_example
|
|||
hypervisor_vendor
string
|
on success |
Hypervisor vendor.
Sample:
hypervisor_vendor_example
|
|||
hypervisor_version
string
|
on success |
Hypervisor version.
Sample:
hypervisor_version_example
|
|||
vmware_v_center
complex
|
on success |
|
|||
data_center
string
|
on success |
Data center name.
Sample:
data_center_example
|
|||
vcenter_key
string
|
on success |
vCenter unique key.
Sample:
vcenter_key_example
|
|||
vcenter_version
string
|
on success |
Dot-separated version string.
Sample:
vcenter_version_example
|
|||
vmware_vm
complex
|
on success |
|
|||
cluster
string
|
on success |
Cluster name.
Sample:
cluster_example
|
|||
customer_fields
list
/ elements=string
|
on success |
Customer fields.
|
|||
customer_tags
complex
|
on success |
Customer defined tags.
|
|||
description
string
|
on success |
The tag description.
Sample:
description_example
|
|||
name
string
|
on success |
The tag name.
Sample:
name_example
|
|||
fault_tolerance_bandwidth
integer
|
on success |
Fault tolerance bandwidth.
Sample:
56
|
|||
fault_tolerance_secondary_latency
integer
|
on success |
Fault tolerance to secondary latency.
Sample:
56
|
|||
fault_tolerance_state
string
|
on success |
Fault tolerance state.
Sample:
fault_tolerance_state_example
|
|||
instance_uuid
string
|
on success |
vCenter-specific identifier of the virtual machine.
Sample:
instance_uuid_example
|
|||
is_disks_cbt_enabled
boolean
|
on success |
Indicates that change tracking is supported for virtual disks of this virtual machine. However, even if change tracking is supported, it might not be available for all disks of the virtual machine.
Sample:
True
|
|||
is_disks_uuid_enabled
boolean
|
on success |
Whether changed block tracking for this VM's disk is active.
Sample:
True
|
|||
path
string
|
on success |
Path directory of the asset.
Sample:
path_example
|
|||
vmware_tools_status
string
|
on success |
VMware tools status.
Sample:
vmware_tools_status_example
|
Authors¶
Oracle (@oracle)