Skip to content

gve-vse-tim/BRKDEV-2004-CL21

 
 

Repository files navigation

Automating UCS Server Provisioning with Terraform and Intersight

This repository pairs with the Cisco Live 2021 Anytime Breakout Session BRKDEV-2004 session. The guiding principle for this example repository is to provide a working, usable set of Terraform configuration files. While some best practices may suggest a more frequent use of variables throughout the plan, (a) that approach would reduce the educational value and (b) many of these "hard coded" values derive from existing best practice parameters within the UCS ecosystem. Of course, they should be adjusted based on your application needs but (with any luck) most will not need to be changed.

There are some organization specific variables that were built into this Terraform configuration. Those variables and their defaults are defined in the variables.tf file of each subdirectory. You should absolutely changed those to match your organization.

Use case

The primary use case as showcased in the 02-full-profile workspace is building a comprehensive server profile and the component policies. The assumption for the build is that we are constructing a hypervisor that needs 4 ethernet adapters, 2 fibre channel adapters, and also has a large pool of local disks to be leveraged as a single RAID6 archive.

Pre-requisites

Required Variables

The following environment variables are required to be set for all Terraform plans in this repository:

  • TF_VARS_intersight_apikey: The API key with administrative access to the Intersight account
  • TF_VARS_intersight_secretkey: The Secret keyfile contents for the provided API key
  • TF_VARS_c240_m4l_lab_device_id: The serial number for the C-series server being used in this demo

For the full profile Terraform plan 02-full-profile/main.tf, you'll also need to define these SNMP related security credentials:

  • TF_VAR_snmp_access_community_string: SNMP v1/v2c community string
  • TF_VAR_snmp_trap_community_string: SNMP v1/v2c trap community string

Please refer to the setup-environment-vars.txt file to show a "safe" method for storing the credentials in your local acount - "safe", of course, in this case with regards to avoiding accidental commits of your credentials to the Git repository.

How to use this repository

The workspace 01-simple-inventory provides a very minimal Terraform configuration to simply help you get your core credentials defined, tested, and also give you some sample Terraform commands and output to help navigate your first time with Terraform and Intersight.

The workspace 02-full-profile requires a couple more environment variables (as mentioned above) but will build a comprehensive set of policies and bind them to a server profile within Intersight.

Wanna stay up to date?

This repository will stay static as a "historical reference" to pair with the Cisco Live session that can be found at Cisco Live's website. I will be keeping a reasonably up to date version of this repository in my personal directory: Introduction to Terraform and Intersight

Feel free to submit issues and/or pull requests against that repository and I'll do my best to keep things updated.

About

Cisco Live Virtual 2021 session BRKDEV-2004

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 100.0%