Skip to content

terraform-cisco-modules/terraform-intersight-profiles-server

Repository files navigation

License: GPL v3 Developed by: Cisco

Terraform Intersight Profiles - Server

Manages Intersight Server Profiles

Location in GUI: Profiles » Create Profile » Server

Easy IMM

Easy IMM - Comprehensive Example - A comprehensive example for policies, pools, and profiles.

Example

main.tf

module "server" {
  source  = "terraform-cisco-modules/profiles-server/intersight"
  version = ">= 1.0.1"

  action              = "No-Op"
  description         = "default Server Profile."
  name                = "default"
  organization        = "default"
  serial_number       = "FO1324556"
  target_platform     = "FIAttached"
  uuid_pool           = "default"
  wait_for_completion = false
}

provider.tf

terraform {
  required_providers {
    intersight = {
      source  = "CiscoDevNet/intersight"
      version = ">=1.0.32"
    }
  }
  required_version = ">=1.3.0"
}

provider "intersight" {
  apikey    = var.apikey
  endpoint  = var.endpoint
  secretkey = fileexists(var.secretkeyfile) ? file(var.secretkeyfile) : var.secretkey
}

variables.tf

variable "apikey" {
  description = "Intersight API Key."
  sensitive   = true
  type        = string
}

variable "endpoint" {
  default     = "https://intersight.com"
  description = "Intersight URL."
  type        = string
}

variable "secretkey" {
  default     = ""
  description = "Intersight Secret Key Content."
  sensitive   = true
  type        = string
}

variable "secretkeyfile" {
  default     = "blah.txt"
  description = "Intersight Secret Key File Location."
  sensitive   = true
  type        = string
}

Environment Variables

Terraform Cloud/Enterprise - Workspace Variables

  • Add variable apikey with the value of [your-api-key]
  • Add variable secretkey with the value of [your-secret-file-content]

Linux and Windows

export TF_VAR_apikey="<your-api-key>"
export TF_VAR_secretkeyfile="<secret-key-file-location>"

Requirements

Name Version
terraform >=1.3.0
intersight >=1.0.32

Providers

Name Version
intersight 1.0.32

Inputs

Name Description Type Default Required
apikey Intersight API Key. string n/a yes
endpoint Intersight URL. string "https://intersight.com" no
secretkey Intersight Secret Key. string n/a yes
action Action to Perform on the Chassis Profile Assignment. Options are:
* Deploy
* No-op
* Unassign
string "No-op" no
description Description for the Profile. string "" no
moids Flag to Determine if pools and policies should be data sources or if they already defined as a moid. bool false no
name Name for the Profile. string "default" no
organization Intersight Organization Name to Apply Policy to. https://intersight.com/an/settings/organizations/. string "default" no
policies Map for Moid based Policy Sources. any {} no
policy_bucket List of Policies to Assign to the Profile.
list(object(
{
name = string
object_type = string
policy = optional(string)
}
))
[] no
pools Map for Moid based Pool Sources. any {} no
resource_pool Name of the Server Resource Pool to assign to the Policy. string "" no
serial_number Serial Number of the Chassis to Assign. string "" no
server_template The Name of the Server Template to Assign to the Server. string "" no
static_uuid_address The UUID address for the server must include UUID prefix xxxxxxxx-xxxx-xxxx along with the UUID suffix of format xxxx-xxxxxxxxxxxx. Joined with a '=' string "" no
tags List of Tag Attributes to Assign to the Policy. list(map(string)) [] no
target_platform The platform for which the chassis profile is applicable. It can either be a chassis that is operating in standalone mode or which is attached to a Fabric Interconnect managed by Intersight.
* FIAttached - Chassis which are connected to a Fabric Interconnect that is managed by Intersight.
string "FIAttached" no
type Defines the type of the profile. Accepted values are:
* instance
* template
string "instance" no
uuid_pool Name of a UUID Pool to Assign to the Policy. string "" no
wait_for_completion This model object can trigger workflows. Use this option to wait for all running workflows to reach a complete state. bool false no

Outputs

Name Description
moid UCS Server Profile Managed Object ID (moid).

Resources

Name Type
intersight_server_profile.server resource
intersight_access_policy.imc_access data source
intersight_adapter_config_policy.adapter_configuration data source
intersight_bios_policy.bios data source
intersight_boot_precision_policy.boot_order data source
intersight_certificatemanagement_policy.certificate_management data source
intersight_compute_physical_summary.server data source
intersight_deviceconnector_policy.device_connector data source
intersight_iam_end_point_user_policy.local_user data source
intersight_iam_ldap_policy.ldap data source
intersight_ipmioverlan_policy.ipmi_over_lan data source
intersight_kvm_policy.virtual_kvm data source
intersight_memory_persistent_memory_policy.persistent_memory data source
intersight_networkconfig_policy.network_connectivity data source
intersight_ntp_policy.ntp data source
intersight_organization_organization.org_moid data source
intersight_power_policy.power data source
intersight_resourcepool_pool.resource_pool data source
intersight_sdcard_policy.sd_card data source
intersight_server_profile_template.template data source
intersight_smtp_policy.smtp data source
intersight_snmp_policy.snmp data source
intersight_sol_policy.serial_over_lan data source
intersight_ssh_policy.ssh data source
intersight_storage_storage_policy.storage data source
intersight_syslog_policy.syslog data source
intersight_uuidpool_pool.uuid_pool data source
intersight_vmedia_policy.virtual_media data source
intersight_vnic_lan_connectivity_policy.lan_connectivity data source
intersight_vnic_san_connectivity_policy.san_connectivity data source