Newer
Older
- borderrouter that connects dmznet to bright-external-flat-externalnet
- a floating ip address, and an instance coming off of dmznet
- clusternet off of dmznet instance
- clustersubnet
will connect instance to ood through ohpc and download software
### Make a new directory for Terraform:
- `$mkdir terraform-first-instance`
Install terraform from your systems package manager or [directly from HashiCorp](https://learn.hashicorp.com/terraform/getting-started/install.html).
Terraform is a single binary so it's easy to maintain the latest release version
from the distributed zip files.
On a Mac (using brew package manager):
On a linux box (using the upstream package installed to personal
~/bin already in the $PATH):
```
wget https://releases.hashicorp.com/terraform/0.12.3/terraform_0.12.3_linux_amd64.zip
unzip terraform_0.12.3_linux_amd64.zip -d ~/bin
```
### Unzip the file and make a path to your new directory using:
- `$export TERRAFORM_DIR="$(pwd)/terraform-first-instance`
- `$cp $HOME/Downloads/terraform_0.6.16_linux_amd64/terraform $TERRAFORM_DIR`
### Create a new application credintial in Openstack:
- In Openstack, go to **Identity** -> **Application Credentials**
- Click "**Create Application Credential**"
- Name the credential, add a description, and check the box making it unrestricted (Leave the rest blank. It is important not to add an expiration date.)
- Save credentials RC file in your terraform-first-instance directory.
### Clone this repo into your terraform-first-instance directory using:
- `$git clone --recursive https://gitlab.rc.uab.edu/rrand11/terraform-openstack.git`
- `$source CREDENTIALRCFILENAME`
### Write Terraform Plan to your terraform-first-instance directory and run that plan:
- `$terraform plan -out $HOME/terraform-first-instance/terraform-plan.tf`
Ryan Randles Jones
committed
**_(Note)_** `$terraform plan -out` writes the plan to a file and then `terraform apply` runs that plan.
Ryan Randles Jones
committed
- `$terraform apply "$HOME/terraform-first-instance/terraform-plan.tf"`
Ryan Randles Jones
committed
### There's a target parameter that will let you specify just one module as defined in the root main file. Run it via plan like so:
Ryan Randles Jones
committed
- `$terraform plan -out $HOME/terraform-first-instance/name-of-plan.tf -target=module.name-of-module-to-run`
**_(Note)_** You can also target multiple modules.
- `$terraform plan -out $HOME/terraform-first-instance/name-of-plan.tf -target=module.name-of-module -target=module.name-of-other-module`
### Destroy Terraform Instance: