ome_configuration_compliance (Resource)

This terraform resource is used to manage configuration baseline remediations entity of OME. We can Create, Update and Delete the OME configuration baseline remediations using this resource.

~> Note: Exactly one of ref_template_name and ref_template_id and exactly one of device_ids and device_servicetags are required.

~> Note: When schedule is true, following parameters are considered: notify_on_schedule, cron, email_addresses, output_format.

~> Note: Updates are supported for all the parameters.

Example Usage

/*
Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved.
Licensed under the Mozilla Public License Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
    http://mozilla.org/MPL/2.0/
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

# remediate baseline for the specified target devices 
resource "ome_configuration_compliance" "remeditation0" {
  baseline_name = "baseline_name"
  target_devices = [
    {
      device_service_tag = "MX12345"
      compliance_status  = "Compliant"
    }
  ]
}

# remediate baseline for the specified target devices with scheduling
resource "ome_configuration_compliance" "remeditation1" {
  baseline_name = "baseline_name"
  target_devices = [
    {
      device_service_tag = "MX12345"
      compliance_status  = "Compliant"
    }
  ]
  run_later = true
  cron      = "0 00 11 14 02 ? 2032"
}

# Manage a baseline and also remediate it
# create baseline 
resource "ome_configuration_baseline" "baseline" {
  baseline_name      = var.baselinename
  ref_template_name  = "Mytemplate"
  device_servicetags = ["MX12345"]
  description        = "baseline description"
}

# create a compliance resource from above baseline
resource "ome_configuration_compliance" "remeditation" {
  baseline_name = var.baselinename
  target_devices = [
    {
      device_service_tag = "MX12345"
      compliance_status  = "Compliant"
    }
  ]
  depends_on = [
    ome_configuration_baseline.baseline
  ]
}

After the execution of above resource block, devices would have been compliant with template on the OME. For more information, Please check the terraform state file.

Schema

Required

Optional

  • baseline_id (Number) Id of the Baseline. Cannot be updated.
  • baseline_name (String) Name of the Baseline. Cannot be updated.
  • cron (String) Cron to schedule the remediation task.
  • job_retry_count (Number) Number of times the job has to be polled to get the final status of the resource. Default value is 30.
  • run_later (Boolean) Provides options to schedule the remediation task immediately, or at a specified time.
  • sleep_interval (Number) Sleep time interval for job polling in seconds. Default value is 20.

Read-Only

  • id (String) ID of the configuration compliance resource.

Nested Schema for target_devices

Required:

  • compliance_status (String) End compliance status of the target device, used to check the drifts in the compliance status. Valid values are Compliant.
  • device_service_tag (String) Target device servicetag to be remediated.