Skip to main content

Creating an update-compliance policy

Use this definition to create an update-compliance policy.

A job is created to complete this request.

Usage

resource "lxco_firmware" "createPolicy" {
policy_action = "createPolicy"
name = string
description = string
compliance_rule = string
rules {
platformidentifier = string
criteria {
targetcomponentid = string
targetupdatepackageid = string
}
criteria {
targetcomponentid = string
targetupdatepackageid = string
}
criteria {
targetcomponentid = string
targetupdatepackageid = string
}
}
}

output "createPolicy" {
value = lxco_firmware.createPolicy
}

Example

The following example creates a policy.
terraform {
required_providers {
lxco = {
version = "0.1"
source = "lenovo.com/xclarity/lxco"
}
}
}

provider "lxco" {
host = "192.0.2.0"
# username = ""
# password = ""
}

# Create a firmware-compliance policy, and return the results
resource "lxco_firmware" "createPolicy" {
policy_action = "createPolicy"
name = "TestPolicy05"
description = "TestPolicy05"
compliance_rule = "FlagIfNotExactMatch"
rules {
platformidentifier = "lxca"
criteria {
targetcomponentid = "LXPM-7X04"
targetupdatepackageid = "lnvgy_fw_lxpm_pdl132e-2.03_anyos_noarch"
}
criteria {
targetcomponentid = "UEFI-7X04"
targetupdatepackageid = "lnvgy_fw_uefi_tee168j-2.91_anyos_32-64"
}
criteria {
targetcomponentid = "XCC-7X04"
targetupdatepackageid = "lnvgy_fw_xcc_cdi376s-6.60_anyos_noarch"
}
}
}

output "createPolicy" {
value = lxco_firmware.createPolicy
}

Inputs

NameRequired / OptionalTypeDescription
nameRequiredStringPolicy name
descriptionRequiredStringPolicy description
compliance_ruleRequiredStringIndicates when to flag a resource as non-compliant. This can be one of the following values.
  • DoNotFlag. Devices that are out of compliance are not flagged
  • FlagIfNotExactMatch. If the software or firmware level that is installed on a resource is not an exact match with the update-compliance policy, the resource is flagged as non-compliant. For example, if you replace a network adapter in a server, and the firmware on that network adapter is different than the level identified in the update-compliance policy, then the server is flagged as non-compliant.
rulesRequiredStringInformation about each rule for this policy
 platformidentifierRequiredStringID of the platform (resource type) that is associated with the target component
 criteriaRequiredStringInformation about the target component and update for this policy

You can specify one or more criteria objects, one for each target component.

Tip: If the platform does not have components, specify the platform ID.

  targetcomponentidRequiredStringTarget component ID
  targetupdatepackageidRequiredStringTarget update package ID

Outputs

NameTypeDescription
idStringJob ID
statusStringMessage about the status of the action
The following example is returned if the request is successful.
{
"id": "125",
"status": "The job was created successfully. The job was launched in the
orchestrator server and will be run asynchronously. Job ID: 125"
}