Skip to content

philipfischbacher/dse_terraform_ansible_aws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Terraform and Ansible Automation Script

For creating a DSE testing environment on AWS.

AWS

Prerequisites

Setup AWS Credentials for Terraform

https://registry.terraform.io/providers/hashicorp/aws/latest/docs#environment-variables

Create a SSH Key .pub file

  1. Create and download a pem file private key from AWS.
ssh-keygen -y -f PRIVATE_KEY.pem > PUBLIC_KEY.pub
  1. Extract the public key from the private key.
ssh-keygen -y -f PRIVATE_KEY.pem > PUBLIC_KEY.pub
  1. Place the PUBLIC_KEY.pub file in the ./credentials directory
  2. Update the config.tfvars files ssh_key_filename field with the ssh key file name.

Terraform

Update the config_sample.tfvars file with your desired values and save as config.tfvars. Don't forget to include the ssh public key.

Run the terraform plan command

This can help check to see if the terraform configuration is ok.

terraform plan -var-file=config.tfvars

Run the terraform apply command

This will actually create the infrastructure

terraform apply -var-file=config.tfvars

Delete and clean up

This will delete all the infrastructure resources created with Terraform

terraform destroy -var-file=config.tfvars

Ansible

Copy the hosts file from Terraform

Copy the hosts file created by Terraform from the terraform/ansible/ directory into the ansible directory

cp ./terraform/ansible/hosts ./ansible

Update the variables

Edit the ./group_vars/all file and set the variables as needed.

Generate the SSL certificates

Run the ansible playbook to generate the SSL certificates.

ansible-playbook ./playbooks/generate_certs.yaml

Install DSE

Run the ansible playbook to install DSE.

ansible-playbook ./playbooks/install_dse.yaml

About

For quickly provisioning a testing environment for DSE.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published