ome_configuration_baseline (Resource)
This terraform resource is used to manage configuration baseline entity of OME. We can Create, Update and Delete the OME configuration baseline using this resource. We can also do an ‘Import’ an existing ‘configuration baseline’ from OME .
Note: Exactly one of
ref_template_name
andref_template_id
and exactly one ofdevice_ids
anddevice_servicetags
are required.
Note: When
schedule
istrue
, following parameters are considered:notify_on_schedule
,cron
,email_addresses
,output_format
.
Note: Updates are supported for all the parameters.
Example Usage
/*
Copyright (c) 2023 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.
*/
# Manage baseline using Device Servicetags
resource "ome_configuration_baseline" "baseline_name" {
baseline_name = "Baseline Name"
device_servicetags = ["MXL1234", "MXL1235"]
}
# Create Baseline using device ids
resource "ome_configuration_baseline" "baseline1" {
baseline_name = "baseline1"
ref_template_id = 745
device_ids = [10001, 10002]
description = "baseline description"
}
# Create Baseline using device servicetag with daily notification scheduled
resource "ome_configuration_baseline" "baseline2" {
baseline_name = "baseline2"
ref_template_id = 745
device_servicetags = ["MXL1234", "MXL1235"]
description = "baseline description"
schedule = true
notify_on_schedule = true
email_addresses = ["test@testmail.com"]
cron = "0 30 11 * * ? *"
output_format = "csv"
}
# Create Baseline using device ids with daily notification on status changing to non-compliant
resource "ome_configuration_baseline" "baseline3" {
baseline_name = "baseline3"
ref_template_id = 745
device_ids = [10001, 10002]
description = "baseline description"
schedule = true
email_addresses = ["test@testmail.com"]
output_format = "pdf"
}
After the execution of above resource block, configuration baseline template would have been created on the OME. For more information, Please check the terraform state file.
Schema
Required
baseline_name
(String) Name of the Baseline.
Optional
cron
(String) Cron expression for notification schedule. Can be set only when bothschedule
andnotify_on_schedule
are set totrue
.description
(String) Description of the baseline.device_ids
(Set of Number) List of the device id on which the baseline compliance needs to be run. Conflicts withdevice_servicetags
.device_servicetags
(Set of String) List of the device servicetag on which the baseline compliance needs to be run. Conflicts withdevice_ids
.email_addresses
(Set of String) Email addresses for notification. Can be set only whenschedule
istrue
.job_retry_count
(Number) Number of times the job has to be polled to get the final status of the resource. Default value is30
.notify_on_schedule
(Boolean) Schedule notification via cron or any time the baseline becomes non-compliant. Default value isfalse
.output_format
(String) Output format type, the input is case senitive. Valid values arehtml
,csv
,pdf
andxls
. Default value ishtml
.ref_template_id
(Number) Reference template ID. Conflicts withref_template_name
.ref_template_name
(String) Reference template name. Conflicts withref_template_id
.schedule
(Boolean) Schedule notification via email. Default value isfalse
.sleep_interval
(Number) Sleep time interval for job polling in seconds. Default value is20
.
Read-Only
id
(Number) ID of the configuration baseline resource.task_id
(Number) Task id associated with baseline.
Import
Import is supported using the following syntax:
# /*
# Copyright (c) 2023 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.
# */
terraform import ome_configuration_baseline.create_baseline "<existing_baseline_name>"