Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

A simple example of using Terraform to spin vRA machines and run Chef on them.

Notifications You must be signed in to change notification settings

mcascone/Terraform-vra-chef-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Terraform vra chef example

A very basic Terraform example to spin up a server on a vRa host and run Chef on it.

I've left this repo in a working state as an example to build more advanced automation off of. I've made it as generic as possible, parameterized everything, etc. There are still a few places where you need your own files - specifically, the <username>.pem file that is created by the chef server when setting up your chef account. I don't know of a way around this at this time. I'm sure someone smarter than me already knows the answer - please share here!

The chef provisioning is tested and it works!

How to use this repo

  1. Clone it down to your local.

  2. Install Terraform 11, and make sure it's on your $PATH

  3. Set your environment variables: see my powershell profile gist

  4. Copy your chef private key into the local repo:

    cp ~/.chef/<username>.pem .
  5. Run terraform init

    1. This will automatically install the vra7 provider driver for you.
  6. Run terraform plan

  7. Run terraform apply -auto-approve

  8. Bask in the ease with which you can now spin up any number of vRa machines!

Tips and Tricks

  1. The server_count default is 1. To change this:

    1. Edit main.tf or variables.tf depending on your needs, or
    2. Run TF with a command-line variable argument:
    terraform [plan, apply] -var server_count=10
    1. This applies to any variable defined in variables.tf.

Next Steps

  1. Get Chef working as a Terraform Provisioner
  2. Update node names and other identifying info to be compatible with multi-machine runs.
    1. I haven't tested that it doesn't work, but i have a feeling it'll collide with itself without dynamically-incrementing names/id's.
  3. Get and POC production permisisons and workflow

About

A simple example of using Terraform to spin vRA machines and run Chef on them.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages