You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Go to file
Curtis Wilson 36867e0ef2 Merge branch 'new-vpc' into 'checkin'
New VPC

See merge request ANDSAS/ops/terraform/nodes-terraform!1
4 years ago
modules Move constant variables to their own modules. 4 years ago
.gitignore Fixed gitignore. 4 years ago
.terraform.lock.hcl Single AWS node is working. 4 years ago
README.md Document dev environment. 4 years ago
cloud_init.cfg Make node-config accept ec2 type per group. 4 years ago
example.tfvars Make node-config accept ec2 type per group. 4 years ago
get-aws-node-status.sh Added a script to poll AWS node status. 4 years ago
get-libvirt-bridge-ips.sh libvirt bridged network interface 4 years ago
get-vm-ips.sh Added proxy and ZFS drives. 4 years ago
main.tf Use new VPC. 4 years ago
providers.tf Added proxy and ZFS drives. 4 years ago
variables.tf Use new VPC. 4 years ago

README.md

A terraform script that will setup VMs via AWS or KVM/QEMU (libvirt).

The modules allow you create N VMs of a specific type. So you could create 1 master node and 3 worker nodes or you could create 3 Ubuntu VMs and 5 CentOS VMs, or whatever fits your needs.

This script creates the VMs and then uses Cloud-init for initial configuration of the VMs.

libvirt vs. AWS

This script allows VMs to be created libvirt or AWS. You can choose either one, however, running both at the same time has not been tested. Therefore, when using one, you should comment out all code pertaining to the other provider.

Cloud-Init

Both the libvirt and aws modules use cloud-init for initial configuration of the VMs. Cloud-init is used to create the admin user and add the mss-admin keys. Cloud-init is also used to install some initial packages. The goal is to get these VMs setup enough so that they can be configured via Ansible.

Environment Setup

  1. From within the nodes-terraform directory run terraform init. You will a see bunch if output as terraform grabs the dependencies it needs.

  2. Copy the shared terraform.tfvars from S3.

    aws s3 cp s3://mss-terraform-state/global/s3/terraform.tfvars .
    

    For instructions on getting AWS CLI to work correctly see aws-api-setup.md in the doc-ops repo.

    Take care to copy your terraform.tfvars back to the S3 bucket whenever you make a change to it.

  3. Verify that you branch and variables match whats deployed by running terraform plan. If everything is in sync you should see No changes. Your infrastructure matches the configuration. IF you do not see this message make sure to sync with the other admins before continuing.

Dependencies

UNFINISHED TODO REM add libvirt provider libvirt provider depends on mkisofs

security_driver = none for ubuntu host, link github issue. https://github.com/dmacvicar/terraform-provider-libvirt/issues/546

Other

Create a password hash.

python3 -c 'import crypt; print(crypt.crypt("test", crypt.mksalt(crypt.METHOD_SHA512)))'