Skip to content
Snippets Groups Projects
README.md 2.04 KiB
Newer Older
Ryan Randles Jones's avatar
Ryan Randles Jones committed
# Terraform Openstack
### This will create:
- dmznet and dmzsubnet
- 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`
Ryan Randles Jones's avatar
Ryan Randles Jones committed

### Install Terraform:
- `$brew install terraform`
### 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 and add a description (Leave the rest blank. It is important not to add an expiration date.)
- Open the credential rc file you have created, and change all OS_ to TF_. This will allow terraform to read and use these values.
- Save the credential in your terraform-first-instance directory.
- Download RC File from Openstack(V3) and save it 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 the openrc file and enter your password for openstack (you will only need to do this the very first time) using:
- `$source OPENRCFILENAME`
### Source the credential rc file and initialize terraform:
- `$source CREDENTIALRCFILENAME`
- `$cd terraform-openstack`
Ryan Jones's avatar
Ryan Jones committed

- `$terraform init`
### Write Terraform Plan to your terraform-first-instance directory and run that plan:
- `$terraform plan -out $HOME/terraform-first-instance/terraform-plan.tf`
Ryan Jones's avatar
Ryan Jones committed

**_(Note)_** `$terraform plan -out` writes the plan to a file and then `terraform apply` runs that plan.
- `$terraform apply "$HOME/terraform-first-instance/terraform-plan.tf"`
Ryan Jones's avatar
Ryan Jones committed

### Destroy Terraform Instance:
Ryan Jones's avatar
Ryan Jones committed

- `$terraform destroy`