This is a Terraform project to deploy DigitalOcean droplets for my LPI classes
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Theodotos Andreou cdb4915199 Corrected the source path il y a 5 ans
.gitignore Initial Commit il y a 5 ans
README.md Corrected the source path il y a 5 ans
lpi.tf Initial Commit il y a 5 ans
terraform.tfvars.example Initial Commit il y a 5 ans
variables.tf Initial Commit il y a 5 ans

README.md

Terraform setup for DigitalOcean

This is a teraform setup for my LPI Labs. The servers are deployed on DigitalOcean. The DNS is automatically updated with the server names.

Prerequisites

  • Install Terraform on your local host:
$ wget https://releases.hashicorp.com/terraform/0.11.7/terraform_0.11.7_linux_amd64.zip
$ unzip terraform_0.11.7_linux_amd64.zip
$ sudo cp terraform /usr/local/bin

Instructions

  • Get the repo
$ git clone https://git.theo-andreou.org/Personal/lpi-deploy-digitalocean.git
$ cd lpi-deploy-digitalocean
  • Copy the terraform.tfvars.example to terraform.tfvars and setup your settings:
do_token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
domain = "example.org"
count = 14

server_name = {
  "debian" = "lpi-deb"
  "centos" = "lpi-centos"
}

images = {
  "debian" = "debian-9-x64"
  "centos" = "centos-7-x64"
}

ssh_keys = [
    "xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx",
]

dns_server = "ns1.example.org"
dns_key_name = "control.ns1.example.org"
dns_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxx+xxx=="
  • Initialize your Terraform environment:
$ terraform init
  • Create a Terraform plan:
$ terraform plan -out lpi.plan
  • Apply the plan:
$ terraform apply "lpi.plan"

References