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.
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.
The following environment variables are required to be set for all Terraform
plans in this repository:
For the full profile Terraform plan 02-full-profile/main.tf, you'll
also need to define these SNMP related security credentials:
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.
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.
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.
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 provides a comprehensive set of server policies and server profile sufficient to configure a UCS C-series rack mount server (in standalone management mode) that is connected to Intersight as a hypervisor with ethernet, fibre channel, and local storage resources.
git clone https://github.com/CiscoSE/BRKDEV-2004-CL21
cd BRKDEV-2004-CL21
# For use case 1 (see README for details)
cd 01-simple-inventory
terraform init
terraform plan
terraform apply
cd ..
# For use case 2 (see README for details, variables are needed!)
cd 02-full-profile
terraform init
terraform plan
terraform apply
cd ..
The following environment variables are required to be set for all Terraform plans in this repository:
For the full profile Terraform plan 02-full-profile/main.tf, you'll also need to define these SNMP related security credentials:
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.
Owner
Contributors
Categories
Products
IntersightUCS ManagerProgramming Languages
HCLLicense
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community