GithubHelp home page GithubHelp logo

dell / terraform-provider-ome Goto Github PK

View Code? Open in Web Editor NEW
6.0 4.0 5.0 720 KB

Terraform provider for OpenManage Enterprise

Home Page: https://registry.terraform.io/providers/dell/ome/latest/docs

License: Mozilla Public License 2.0

Makefile 0.24% Go 99.76%
iac iac-terraform infrastructure-as-code openmanage-enterprise poweredge poweredge-idrac terraform

terraform-provider-ome's Introduction

Terraform provider for OpenManage Enterprise

Contributor Covenant License Go version Terraform version GitHub release (latest by date including pre-releases)

The Terraform Provider for OpenManage Enterprise is a provider for terraform that allows the resource management of PowerEdge servers using OpenManage Enterprise (OME). For more details on OME, please refer to OME official webpage here.

For general information about Terraform, visit the official website and the GitHub project page.

Table of Contents

Supported Platforms

  • Dell OpenManage Enterprise versions 3.10.x and 4.0.1

Prerequisites

Terraform Provider OS Terraform Golang
v1.2.0 Ubuntu22.04
RHEL9.x
1.5.x
1.6.x
1.21

List of DataSources in Terraform Provider for Dell OME

  • Configuration Report
  • Device Groups
  • Template
  • VLAN Networks
  • Device Datasource
  • Device Compliance Report
  • Application Certificate Datasource
  • Firmware Repository
  • Firmware Baseline Compliance Report
  • Firmware Catalog

List of Resources in Terraform Provider for Dell OME

  • Configuration Baseline
  • Configuration Compliance
  • Deployment
  • Template
  • User Resource
  • Static Group Resource
  • Discovery Resource
  • Devices Resource
  • Device Action Resource
  • Application CSR Resource
  • Application Certificate Resource
  • Appliance Network Resource
  • Firmware Catalog
  • Firmware Baselines

Installation

Install Terraform Provider for OpenManage Enterprise from terraform registry by adding the following block

terraform {
  required_providers {
    ome = {
      version = "1.2.0"
      source  = "dell/ome"
    }
  }
}

For adding resources, please refer examples

About

Terraform Provider for OpenManage Enterprise is 100% open source and community-driven. All components are available under MPL-2.0 license on GitHub.

Releasing, Maintenance and Deprecation

Terraform Provider for Dell Technnologies PowerMax follows Semantic Versioning.

New versions will be released regularly if significant changes (bug fix or new feature) are made in the provider.

Released code versions are located on tags in the form of "vx.y.z" where x.y.z corresponds to the version number.

Documentation

For more detailed information on the provider, please refer to Dell Terraform Providers Documentation.

terraform-provider-ome's People

Contributors

dependabot[bot] avatar doriac11 avatar gibarrama avatar krishnan-priyanshu avatar naveen-patil-dell avatar nikitajoshi1 avatar rounak-adhikary avatar sachin-apa avatar shekhar-j avatar soorajbharadwaj07 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

terraform-provider-ome's Issues

[BUG]: Deleting deployment template from GUI results in error on next plan

Bug Description

If a resource created via Terraform is deleted in the GUI, this will result in an error when attempting to run another terraform operation.

Normally, I think you'd check if the error returned from

omeTemplateData, err := omeClient.GetTemplateByID(templateID)
was a 404 and mark the resource as deleted.

Resource or DataSource Name

ome_template

Terraform Version

1.5.4

go Version

n/a

OME Version

3.10.0 (Build 169)

Operating System

Linux

Terraform File Used

resource "ome_template" "test" {
  name       = "Test"
  content    = file("${path.module}/template.xml")
}

Logs

╷
│ Error: Unable to read template
│ 
│ status: 400, body: {"error":{"code":"Base.1.0.GeneralError","message":"A
│ general error has occurred. See ExtendedInfo for more
│ information.","@Message.ExtendedInfo":[{"MessageId":"CTEM1026","RelatedProperties":[],"Message":"Unable
│ to process the request because the template ID 59 provided is
│ invalid.","MessageArgs":["59"],"Severity":"Informational","Resolution":"Enter
│ a valid template ID and retry the operation. For information about valid
│ template IDs. Refer to the API Guide or Product Guide available on the
│ support site."}]}}
╵


Error: Failed to perform terraform plan. Unexpected exit code: 1

Steps to Reproduce

Create an ome_template resource via terraform. Delete the resource from the GUI and run terraform plan

Expected Behavior

The Terraform plan succeeds.

If the resource is still declared in the code, create a new deployment template.

If the resource is not declared in the code, Terraform will not see changes as being necessary.

Actual Behavior

The terraform plan operation fails with the error mentioned previously.

Screenshots

No response

Additional Information

No response

[BUG]: Unable to edit attributes on template created without NIC configuration elements

Bug Description

I am not able to edit the attributes of an ome_template resource that did not have NIC configuration elements enabled. The template itself was created from an XML file exported from another instance of OpenManage Enterprise.

Resource or DataSource Name

ome_template

Terraform Version

1.5.4

go Version

n/a

OME Version

3.10.0 (Build 169)

Operating System

Linux

Terraform File Used

terraform {
  required_providers {
    ome = {
      source  = "dell/ome"
      version = ">= 1.0.0, < 2.0.0"
    }
  }
}

#use locals to modify the attributes required for updating a template using attribute ids.
locals {
  deployment_attributes = var.attributes_map != null ? [
    for attr in data.ome_template_info.main[local.deployment_template_name].attributes : tomap({
      attribute_id = attr.attribute_id
      is_ignored   = attr.is_ignored
      display_name = attr.display_name
      value        = lookup(var.attributes_map, attr.display_name, attr.value)
  })] : null

  compliance_attributes = var.attributes_map != null ? [
    for attr in data.ome_template_info.main[local.compliance_template_name].attributes : tomap({
      attribute_id = attr.attribute_id
      is_ignored   = attr.is_ignored
      display_name = attr.display_name
      value        = lookup(var.attributes_map, attr.display_name, attr.value)
  })] : null
  compliance_template_name = "${var.name} Compliance"
  deployment_template_name = "${var.name} Deployment"
}

resource "ome_template" "deployment" {
  name       = local.deployment_template_name
  content    = file("${path.module}/template.xml")
  view_type  = "Deployment"
  attributes = local.deployment_attributes
}

resource "ome_template" "compliance" {
  name       = local.compliance_template_name
  content    = file("${path.module}/template.xml")
  view_type  = "Compliance"
  attributes = local.compliance_attributes
}

data "ome_template_info" "main" {
  for_each = var.attributes_map == null ? [] : toset([local.compliance_template_name, local.deployment_template_name])

  name = each.key
}

variable "name" {
  type        = string
  description = "The name of the template."
}

variable "attributes_map" {
  type        = map(string)
  description = "A map of attributes to set in the template. The key is the attribute display name and the value is the attribute value. Do not set this until after the template has been created."
  default     = null
}


output "deployment_template_id" {
  description = "The ID of the deployment template"
  value       = ome_template.deployment.id
}

output "compliance_template_id" {
  description = "The ID of the compliance template"
  value       = ome_template.compliance.id
}

Logs

module.nsx_edge_template.ome_template.deployment: Modifying... [id=59]
module.nsx_edge_template.ome_template.compliance: Modifying... [id=60]
╷
│ Error: Unable to update template
│ 
│   with module.nsx_edge_template.ome_template.deployment,
│   on ../modules/bare_metal_edge_node_template/main.tf line 22, in resource "ome_template" "deployment":
│   22: resource "ome_template" "deployment" {
│ 
│ vlan attributes are not available in the template
╵
╷
│ Error: Unable to update template
│ 
│   with module.nsx_edge_template.ome_template.compliance,
│   on ../modules/bare_metal_edge_node_template/main.tf line 29, in resource "ome_template" "compliance":
│   29: resource "ome_template" "compliance" {
│ 
│ vlan attributes are not available in the template
╵

Error: Failed to perform terraform apply. Unexpected exit code: 1

Steps to Reproduce

Create the templates initially without the attributes_map variable set. This is successful.

Attempt to set a few values with the attributes_map variable after creation.

Expected Behavior

The terraform apply is successful.

Actual Behavior

The terraform apply fails.

Screenshots

No response

Additional Information

No response

[FEATURE]: Device Discovery

Describe the solution you'd like
Is there a way to bring a new iDRAC device into OME using the Terraform provider? In other words, kick off Discovery of a new device. We do this today with Ansible, but would like to do so with Terraform.

Describe alternatives you've considered
Adding/discovering devices manually through the OME console which is not ideal.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.