Skip to content
Snippets Groups Projects
user avatar
authored
Name Last commit Last update
..
modules/infra
README.md
main.tf

Build and maintain OpenStack infrastructure from command-line using terraform

This Terraform module creates simple virtual infrastructure cluster in OpenStack.

Pre-requisites

  • Linux/Mac/WSL2 terminal
  • installed terraform (how?)
  • downloaded application credentials from OpenStack Horizon dashboard (how?)

Create Infrastructure

  1. Clone the repository.
  2. Load you OpenStack application credentials to environment variables source ~/conf/prod-meta-cloud-new-openstack-all-roles-openrc.sh
  3. Override any variable if needed. Every variable specified in modules/infra/variables.tf can be overridden in the main.tf file in its module section.
  4. In the root folder run terraform init.
  5. In the root folder run terraform validate.
  6. Run terraform plan -out plan1 to generate terraform plan.
  7. Run terraform apply "plan1" to apply the plan.

Destroy Infrastructure

To delete all created resources run the following commands:

terraform plan -destroy -out plan1
terraform apply "plan1"

SSH to nodes

node with associated FIP

Connecting to master is as easy as ssh ubuntu@<any-master-ip>

other nodes

Establish SSH VPN to first head node using sshuttle.

sshuttle -r ubuntu@<any-master-ip> 192.168.0.0/24

Connection to any other node is then via SSH VPN (sshuttle) on internal network i.e. ssh ubuntu@<vm-internal-ip-from-192.168.0.0/24>