TerraformPilot

DevOps

Manage Dell OpenManage Enterprise Templates with Terraform

Create, clone, update, and import Dell OpenManage Enterprise deployment and compliance templates with the dell/ome Terraform provider.

LLuca Berton4 min read

Introduction

#

Dell OpenManage Enterprise (OME) manages server configuration templates. With the Dell OME Terraform provider, you can manage those templates as code using the ome_template resource. This guide covers creating deployment and compliance templates, cloning templates, modifying their attributes, configuring VLANs and identity pools, and importing templates already present in OME.

The examples below follow the dell/ome provider v1.2.4 resource documentation. Replace example device IDs, service tags, template names, and VLAN names with values from your environment.

Prerequisites

#
  • Terraform installed and access to a reachable Dell OpenManage Enterprise appliance
  • A configured dell/ome provider with appropriate appliance credentials and permissions
  • A reference device, existing OME template, or exported XML template to use as your starting point

Do not commit appliance credentials or sensitive template XML to source control. Configure the provider connection according to the provider documentation.

Declare the Provider

#
terraform {
  required_providers {
    ome = {
      source  = "dell/ome"
      version = "1.2.4"
    }
  }
}

Set up the provider connection separately using the authentication options documented for your version.

Create a Deployment Template from a Device

#

Reference an OME device by numeric ID:

resource "ome_template" "from_device_id" {
  name         = "server-template-by-id"
  refdevice_id = 10001
}

Or use the device's service tag:

resource "ome_template" "from_service_tag" {
  name                 = "server-template-by-tag"
  refdevice_servicetag = "MXL1234"
}

You can choose which components to capture through fqdds. Supported values include iDRAC, System, BIOS, NIC, LifeCycleController, RAID, EventFilters, and All (the default). This is a comma-separated string.

resource "ome_template" "network_template" {
  name         = "network-template"
  refdevice_id = 10001
  fqdds        = "NIC"
}

Important: Specify exactly one of refdevice_id, refdevice_servicetag, reftemplate_name, or content. These fields are alternative starting points for the template, not fields to combine.

Clone a Template for Compliance

#

To clone an existing deployment template into a compliance template, use reftemplate_name and view_type:

resource "ome_template" "compliance" {
  name             = "server-compliance"
  reftemplate_name = "server-deployment"
  view_type        = "Compliance"
}

The valid view_type values are Deployment (default) and Compliance.

Create Templates from XML

#

Use content to create a deployment or compliance template from exported XML:

resource "ome_template" "deployment_from_xml" {
  name    = "deployment-from-xml"
  content = file("${path.module}/templates/server-template.xml")
}
 
resource "ome_template" "compliance_from_xml" {
  name      = "compliance-from-xml"
  content   = file("${path.module}/templates/server-template.xml")
  view_type = "Compliance"
}

For XML imports, device_type supports Server (default) or Chassis. The content and device_type properties cannot be updated after creation.

Update Template Attributes

#

The attributes field is for updates only; it is ignored when creating a template. First create the OME template, then read its current attributes through the ome_template_info data source. In a subsequent Terraform update, transform the attributes and pass the complete modified list to the resource.

For example, change two attributes by display name while retaining all other values:

data "ome_template_info" "existing" {
  name = "server-deployment"
}
 
locals {
  desired_attribute_values = {
    "iDRAC,Time Zone Configuration Information,Time 1 Time Zone String" = "IST"
    "System,Server Topology,ServerTopology 1 Aisle Name"                 = "Aisle-123"
  }
 
  updated_attributes = data.ome_template_info.existing.attributes != null ? [
    for attr in data.ome_template_info.existing.attributes : {
      attribute_id = attr.attribute_id
      display_name = attr.display_name
      is_ignored   = attr.is_ignored
      value        = lookup(local.desired_attribute_values, attr.display_name, attr.value)
    }
  ] : null
}

Once the template has been created, add attributes = local.updated_attributes to its ome_template resource and apply the update. The provider also supports looking up values by attribute_id instead of display_name; use the identifiers returned by your appliance.

For identity optimization, you can similarly build a map of is_ignored changes and set targeted entries to false where required. Review the attributes returned by your particular OME template before modifying them.

Attach an Identity Pool and Configure VLANs

#

Identity pool and VLAN settings are applied during a template update, not initial creation. After creating the referenced template, add settings like these to that resource:

data "ome_vlannetworks_info" "available" {}
 
locals {
  vlan_ids = {
    for network in data.ome_vlannetworks_info.available.vlan_networks :
    network.name => network.vlan_id
  }
}
# Add these arguments to an existing ome_template resource
identity_pool_name = "IO1"
 
vlan = {
  propogate_vlan     = true
  bonding_technology = "NoTeaming"
  vlan_attributes = [
    {
      nic_identifier   = "NIC in Mezzanine 1A"
      port             = 1
      is_nic_bonded    = false
      untagged_network = lookup(local.vlan_ids, "VLAN1", 0)
      tagged_networks  = [0]
    },
    {
      nic_identifier   = "NIC in Mezzanine 1B"
      port             = 1
      is_nic_bonded    = false
      untagged_network = 0
      tagged_networks = [
        lookup(local.vlan_ids, "VLAN1", 0),
        lookup(local.vlan_ids, "VLAN2", 0)
      ]
    }
  ]
}

The provider schema spells the field propogate_vlan; preserve this spelling in Terraform configuration. The VLAN IDs and NIC identifiers are environment-specific. A lookup default of 0 follows the documentation example, but verify that your intended VLANs actually exist before applying.

Create Multiple Templates

#

When you have a list of template names and corresponding reference service tags, count can create them together:

variable "ome_template_names" {
  type = list(string)
}
 
variable "ome_template_servicetags" {
  type = list(string)
}
 
resource "ome_template" "servers" {
  count                = length(var.ome_template_names)
  name                 = var.ome_template_names[count.index]
  refdevice_servicetag = var.ome_template_servicetags[count.index]
}

Keep both input lists in the same order and ensure each name has a matching service tag.

Import an Existing OME Template

#

To bring an existing OME template under Terraform management, declare the matching resource block, then import by template name:

terraform import ome_template.existing "existing-template-name"

Inspect the imported state and reconcile your configuration with the OME template before applying additional changes.

Apply and Verify

#

Initialize and validate the Terraform configuration:

terraform init
terraform fmt -check
terraform validate
terraform plan

Review the plan carefully, especially when a property is immutable or you are updating configuration attributes. Apply only after confirming that the changes are intended:

terraform apply

Verify the resulting template in OpenManage Enterprise and inspect the Terraform state as needed.

Resource Reference and Limitations

#
ArgumentPurposeNotes
nameOME template nameRequired
refdevice_id, refdevice_servicetagCreate from a deviceChoose one creation source
reftemplate_nameClone another templateCannot be updated
contentImport XML template contentCannot be updated
fqddsSelect server componentsDefaults to All; cannot be updated
view_typeDeployment or ComplianceDefaults to Deployment; cannot be updated
attributesModify template settingsUpdate only; ignored at create time
identity_pool_nameAttach an identity poolApply after creation
vlanVLAN mapping and NIC settingsApply after creation
job_retry_countNumber of job status pollsDefault 5
sleep_intervalSeconds between pollsDefault 30

Read-only values include id, identity_pool_id, and view_type_id.

Conclusion

#

The ome_template resource makes Dell OpenManage Enterprise server configuration templates reproducible through Terraform. Start with a reference device, existing template, or XML export, then use a separate update to manage attributes, identity pools, and VLAN details. Import already-managed templates to avoid recreating them.

Reference: Terraform Registry: dell/ome ome_template resource

#Terraform#Dell#OpenManage Enterprise#Infrastructure as Code

Share this article