oracle.oci.oci_os_management_managed_instance_actions – Perform actions on a ManagedInstance resource in Oracle Cloud Infrastructure¶
Note
This plugin is part of the oracle.oci collection (version 5.0.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_os_management_managed_instance_actions
.
New in version 2.9.0: of oracle.oci
Synopsis¶
Perform actions on a ManagedInstance resource in Oracle Cloud Infrastructure
For action=attach_child_software_source, adds a child software source to a managed instance. After the software source has been added, then packages from that software source can be installed on the managed instance.
For action=attach_parent_software_source, adds a parent software source to a managed instance. After the software source has been added, then packages from that software source can be installed on the managed instance. Software sources that have this software source as a parent will be able to be added to this managed instance.
For action=detach_child_software_source, removes a child software source from a managed instance. Packages will no longer be able to be installed from these software sources.
For action=detach_parent_software_source, removes a software source from a managed instance. All child software sources will also be removed from the managed instance. Packages will no longer be able to be installed from these software sources.
For action=disable_module_stream, disables a module stream on a managed instance. After the stream is disabled, it is no longer possible to install the profiles that are contained by the stream. All installed profiles must be removed prior to disabling a module stream.
For action=enable_module_stream, enables a module stream on a managed instance. After the stream is enabled, it is possible to install the profiles that are contained by the stream. Enabling a stream that is already enabled will succeed. Attempting to enable a different stream for a module that already has a stream enabled results in an error.
For action=install_all_package_updates, install all of the available package updates for the managed instance.
For action=install_all_windows_updates, install all of the available Windows updates for the managed instance.
For action=install_module_stream_profile, installs a profile for an module stream. The stream must be enabled before a profile can be installed. If a module stream defines multiple profiles, each one can be installed independently.
For action=install_package, installs a package on a managed instance.
For action=install_package_update, updates a package on a managed instance.
For action=install_windows_update, installs a Windows update on a managed instance.
For action=manage_module_streams, perform an operation involving modules, streams, and profiles on a managed instance. Each operation may enable or disable an arbitrary amount of module streams, and install or remove an arbitrary number of module stream profiles. When the operation is complete, the state of the modules, streams, and profiles on the managed instance will match the state indicated in the operation. Each module stream specified in the list of module streams to enable will be in the “ENABLED” state upon completion of the operation. If there was already a stream of that module enabled, any work required to switch from the current stream to the new stream is performed implicitly. Each module stream specified in the list of module streams to disable will be in the “DISABLED” state upon completion of the operation. Any profiles that are installed for the module stream will be removed as part of the operation. Each module stream profile specified in the list of profiles to install will be in the “INSTALLED” state upon completion of the operation, indicating that any packages that are part of the profile are installed on the managed instance. If the module stream containing the profile is not enabled, it will be enabled as part of the operation. There is an exception when attempting to install a stream of a profile when another stream of the same module is enabled. It is an error to attempt to install a profile of another module stream, unless enabling the new module stream is explicitly included in this operation. Each module stream profile specified in the list of profiles to remove will be in the “AVAILABLE” state upon completion of the operation. The status of packages within the profile after the operation is complete is defined by the package manager on the managed instance. Operations that contain one or more elements that are not allowed are rejected. The result of this request is a WorkRequest object. The returned WorkRequest is the parent of a structure of other WorkRequests. Taken as a whole, this structure indicates the entire set of work to be performed to complete the operation. This interface can also be used to perform a dry run of the operation rather than committing it to a managed instance. If a dry run is requested, the OS Management Service will evaluate the operation against the current module, stream, and profile state on the managed instance. It will calculate the impact of the operation on all modules, streams, and profiles on the managed instance, including those that are implicitly impacted by the operation. The WorkRequest resulting from a dry run behaves differently than a WorkRequest resulting from a committable operation. Dry run WorkRequests are always singletons and never have children. The impact of the operation is returned using the log and error facilities of WorkRequests. The impact of operations that are allowed by the OS Management Service are communicated as one or more work request log entries. Operations that are not allowed by the OS Management Service are communicated as one or more work requst error entries. Each entry, for either logs or errors, contains a structured message containing the results of one or more operations.
For action=remove_module_stream_profile, removes a profile for a module stream that is installed on a managed instance. If a module stream is provided, rather than a fully qualified profile, all profiles that have been installed for the module stream will be removed.
For action=remove_package, removes an installed package from a managed instance.
For action=switch_module_stream, enables a new stream for a module that already has a stream enabled. If any profiles or packages from the original module are installed, switching to a new stream will remove the existing packages and install their counterparts in the new stream.
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 ManagedInstance.
|
|
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 ). |
||
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.
|
||
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 . |
||
disable
list
/ elements=dictionary
|
The set of module streams to disable.
Applicable only for action=manage_module_streams.
|
||
module_name
string
/ required
|
The name of a module
|
||
stream_name
string
/ required
|
The name of a stream of the specified module
|
||
enable
list
/ elements=dictionary
|
The set of module streams to enable.
Applicable only for action=manage_module_streams.
|
||
module_name
string
/ required
|
The name of a module
|
||
stream_name
string
/ required
|
The name of a stream of the specified module
|
||
install
list
/ elements=dictionary
|
The set of module stream profiles to install.
Applicable only for action=manage_module_streams.
|
||
module_name
string
/ required
|
The name of a module
|
||
profile_name
string
/ required
|
The name of a profile of the specified module stream
|
||
stream_name
string
/ required
|
The name of a stream of the specified module
|
||
is_dry_run
boolean
|
|
Indicates if this operation is a dry run or if the operation should be commited. If set to true, the result of the operation will be evaluated but not committed. If set to false, the operation is committed to the managed instance. The default is false.
Applicable only for action=manage_module_streams.
|
|
managed_instance_id
string
/ required
|
OCID for the managed instance
aliases: id |
||
module_name
string
|
The name of a module.
Required for action=disable_module_stream, action=enable_module_stream, action=install_module_stream_profile, action=remove_module_stream_profile, action=switch_module_stream.
|
||
profile_name
string
|
The name of the profile of the containing module stream
Applicable only for action=install_module_stream_profileaction=remove_module_stream_profile.
|
||
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. |
||
remove
list
/ elements=dictionary
|
The set of module stream profiles to remove.
Applicable only for action=manage_module_streams.
|
||
module_name
string
/ required
|
The name of a module
|
||
profile_name
string
/ required
|
The name of a profile of the specified module stream
|
||
stream_name
string
/ required
|
The name of a stream of the specified module
|
||
software_package_name
string
|
Package name
Required for action=install_package, action=install_package_update, action=remove_package.
|
||
software_source_id
string
|
OCID for the Software Source
Required for action=attach_child_software_source, action=attach_parent_software_source, action=detach_child_software_source, action=detach_parent_software_source.
|
||
stream_name
string
|
The name of the stream of the containing module. This parameter is required if a profileName is specified.
Applicable only for action=disable_module_streamaction=enable_module_streamaction=install_module_stream_profileaction=remove_module_str eam_profileaction=switch_module_stream.
|
||
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 |
||
update_type
string
|
|
The type of updates to be applied
Applicable only for action=install_all_package_updatesaction=install_all_windows_updates.
|
|
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.
|
||
windows_update_name
string
|
Unique identifier for the Windows update. NOTE - This is not an OCID, but is a unique identifier assigned by Microsoft. Example: `6981d463-cd91-4a26-b7c4-ea4ded9183ed`
Required for action=install_windows_update.
|
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 attach_child_software_source on managed_instance
oci_os_management_managed_instance_actions:
# required
software_source_id: "ocid1.softwaresource.oc1..xxxxxxEXAMPLExxxxxx"
managed_instance_id: "ocid1.managedinstance.oc1..xxxxxxEXAMPLExxxxxx"
action: attach_child_software_source
- name: Perform action attach_parent_software_source on managed_instance
oci_os_management_managed_instance_actions:
# required
software_source_id: "ocid1.softwaresource.oc1..xxxxxxEXAMPLExxxxxx"
managed_instance_id: "ocid1.managedinstance.oc1..xxxxxxEXAMPLExxxxxx"
action: attach_parent_software_source
- name: Perform action detach_child_software_source on managed_instance
oci_os_management_managed_instance_actions:
# required
software_source_id: "ocid1.softwaresource.oc1..xxxxxxEXAMPLExxxxxx"
managed_instance_id: "ocid1.managedinstance.oc1..xxxxxxEXAMPLExxxxxx"
action: detach_child_software_source
- name: Perform action detach_parent_software_source on managed_instance
oci_os_management_managed_instance_actions:
# required
software_source_id: "ocid1.softwaresource.oc1..xxxxxxEXAMPLExxxxxx"
managed_instance_id: "ocid1.managedinstance.oc1..xxxxxxEXAMPLExxxxxx"
action: detach_parent_software_source
- name: Perform action disable_module_stream on managed_instance
oci_os_management_managed_instance_actions:
# required
managed_instance_id: "ocid1.managedinstance.oc1..xxxxxxEXAMPLExxxxxx"
module_name: module_name_example
action: disable_module_stream
# optional
stream_name: stream_name_example
- name: Perform action enable_module_stream on managed_instance
oci_os_management_managed_instance_actions:
# required
managed_instance_id: "ocid1.managedinstance.oc1..xxxxxxEXAMPLExxxxxx"
module_name: module_name_example
action: enable_module_stream
# optional
stream_name: stream_name_example
- name: Perform action install_all_package_updates on managed_instance
oci_os_management_managed_instance_actions:
# required
managed_instance_id: "ocid1.managedinstance.oc1..xxxxxxEXAMPLExxxxxx"
action: install_all_package_updates
# optional
update_type: SECURITY
- name: Perform action install_all_windows_updates on managed_instance
oci_os_management_managed_instance_actions:
# required
managed_instance_id: "ocid1.managedinstance.oc1..xxxxxxEXAMPLExxxxxx"
action: install_all_windows_updates
# optional
update_type: SECURITY
- name: Perform action install_module_stream_profile on managed_instance
oci_os_management_managed_instance_actions:
# required
managed_instance_id: "ocid1.managedinstance.oc1..xxxxxxEXAMPLExxxxxx"
module_name: module_name_example
action: install_module_stream_profile
# optional
profile_name: profile_name_example
stream_name: stream_name_example
- name: Perform action install_package on managed_instance
oci_os_management_managed_instance_actions:
# required
software_package_name: software_package_name_example
managed_instance_id: "ocid1.managedinstance.oc1..xxxxxxEXAMPLExxxxxx"
action: install_package
- name: Perform action install_package_update on managed_instance
oci_os_management_managed_instance_actions:
# required
software_package_name: software_package_name_example
managed_instance_id: "ocid1.managedinstance.oc1..xxxxxxEXAMPLExxxxxx"
action: install_package_update
- name: Perform action install_windows_update on managed_instance
oci_os_management_managed_instance_actions:
# required
windows_update_name: windows_update_name_example
managed_instance_id: "ocid1.managedinstance.oc1..xxxxxxEXAMPLExxxxxx"
action: install_windows_update
- name: Perform action manage_module_streams on managed_instance
oci_os_management_managed_instance_actions:
# required
managed_instance_id: "ocid1.managedinstance.oc1..xxxxxxEXAMPLExxxxxx"
action: manage_module_streams
# optional
is_dry_run: true
enable:
- # required
module_name: module_name_example
stream_name: stream_name_example
disable:
- # required
module_name: module_name_example
stream_name: stream_name_example
install:
- # required
module_name: module_name_example
stream_name: stream_name_example
profile_name: profile_name_example
remove:
- # required
module_name: module_name_example
stream_name: stream_name_example
profile_name: profile_name_example
- name: Perform action remove_module_stream_profile on managed_instance
oci_os_management_managed_instance_actions:
# required
managed_instance_id: "ocid1.managedinstance.oc1..xxxxxxEXAMPLExxxxxx"
module_name: module_name_example
action: remove_module_stream_profile
# optional
profile_name: profile_name_example
stream_name: stream_name_example
- name: Perform action remove_package on managed_instance
oci_os_management_managed_instance_actions:
# required
software_package_name: software_package_name_example
managed_instance_id: "ocid1.managedinstance.oc1..xxxxxxEXAMPLExxxxxx"
action: remove_package
- name: Perform action switch_module_stream on managed_instance
oci_os_management_managed_instance_actions:
# required
managed_instance_id: "ocid1.managedinstance.oc1..xxxxxxEXAMPLExxxxxx"
module_name: module_name_example
action: switch_module_stream
# optional
stream_name: stream_name_example
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Oracle (@oracle)