Applying an update-compliance policy to one or more resources
Uses this definition to apply an update-compliance policy to one or more resources.
A job is created to complete this request.
Usage
resource "lxco_firmware" "applyAndactivate" {
policy_action = "applyAndactivate"
activation_rule = string
force_update = Boolean
group_ids = array of strings
install_prerequisite_firmware = Boolean
policy_id = string
resource_ids = array of strings
update_rule = string
}
output "applyAndactivate" {
value = lxco_firmware.applyAndactivate
}
Example
terraform {
required_providers {
lxco = {
version = "0.1"
source = "lenovo.com/xclarity/lxco"
}
}
}
provider "lxco" {
host = "192.0.2.0"
# username = ""
# password = ""
}
# Apply a firmware-compliance policy, and return the results
resource "lxco_firmware" "applyAndactivate" {
policy_action = "applyAndactivate"
activation_rule = "ImmediateActivation"
force_update = true
group_ids = ["G_162B69BD175947CC9AAD0E0C7CB6045C"]
install_prerequisite_firmware = false
policy_id = "1633679392153"
resource_ids = []
update_rule = "ContinueOnError"
}
output "applyAndactivate" {
value = lxco_firmware.applyAndactivate
}
Inputs
Name | Required / Optional | Type | Description | ||
---|---|---|---|---|---|
activation_rule | Required | String | (Managed devices only) Indicates when to activate the update. This can be one of the following values.
For resource managers, the update is activated immediately. The resource might be restarted automatically several times until the entire process is complete. Ensure that you quiesce all applications on the resource before you proceed. | ||
force_update | Required | Boolean | (Managed devices only) Indicates whether to apply the update to selected components even if the current software or firmware level is up to date or to apply an update that is earlier than the one that is currently installed. Important You cannot apply earlier levels of firmware to device options, adapters, and disk drives. This can be one of the following values.
For resource managers, you cannot apply an update of the same or earlier software level as the one that is currently installed on a resource manager. | ||
group_ids | Required | Array of strings | List of IDs of resource group to which to apply the updates The update is applied to each resource in the specified groups only if the resource has an assigned compliance policy and is out of compliance with that policy. Set this attribute to null if you do not want to specify a group. If resource_ids and group_ids are set to an empty array and policy_id is set to null, all managed resources that are not compliant with their assigned policy are updated by default. | ||
install_prerequisite_firmware | Required | Boolean | (Managed devices only) Indicates whether to install prerequisite updates. Prerequisite updates are installed and activated before the remaining updates are installed and activated. Multiple reboots might be required to install all updates. This can be one of the following values.
For resource managers, prerequisite updates are not applied automatically to resource managers. | ||
policy_id | Optional | String | ID of the update-compliance policy The update is applied to each resource that is assigned the policy only if the resource is out of compliance with that policy. If you specify a policy_id, you must set resource_ids to an empty array. You can specify either policy_id or resources using resource_ids, but not both. If resource_ids and group_ids are set to an empty array and policy_id is set to null, all managed resources that are not compliant with their assigned policy are updated by default. | ||
resource_ids | Required | Array of strings | List of IDs of resources to which to apply the updates The update is applied to each specified resource only if the resource has an assigned compliance policy and is out of compliance with that policy. Set this attribute to an empty array if you do not want to specify a resource. If you specify resources using resource_ids, you cannot specify policy_id. If resource_ids and group_ids are set to an empty array and policy_id is set to null, all managed resources that are not compliant with their assigned policy are updated by default. | ||
update_rule | Required | String | (Managed devices only) Indicates how to handle errors during the update process. This can be one of the following values.
For resource managers, the update always continues on error. |
Outputs
Name | Type | Description | ||
---|---|---|---|---|
id | String | Job ID | ||
status | String | Message about the status of the action |
{
"id":"125",
"status": "The job was created successfully. The job was launched in the
orchestrator server and will be run asynchronously. Job ID: 125"
}