minor refactoring

main
Ricard Illa 2022-08-25 08:59:37 +02:00
parent c7b32af8be
commit 322445b89f
No known key found for this signature in database
GPG Key ID: F69A672B72E54902
4 changed files with 22 additions and 13 deletions

View File

@ -1,6 +1,3 @@
provider "linode" {
}
# https://www.linode.com/docs/guides/import-existing-infrastructure-to-terraform/
resource "linode_instance" "caladan-vm" {
label = "caladan"

17
main.tf
View File

@ -9,5 +9,22 @@ terraform {
source = "linode/linode"
version = ">= 1.29.0"
}
vultr = {
source = "vultr/vultr"
version = "2.11.4"
}
}
}
provider "namecheap" {
user_name = "gthar"
api_user = "gthar"
client_ip = "139.162.137.29" // caladan's public IP
use_sandbox = false
}
provider "linode" {
}
provider "vultr" {
}

View File

@ -127,13 +127,6 @@ variable "sloth-subdomains" {
]
}
provider "namecheap" {
user_name = "gthar"
api_user = "gthar"
client_ip = var.hosts.caladan.v4
use_sandbox = false
}
resource "namecheap_domain_records" "monotremata-xyz" {
domain = "monotremata.xyz"
mode = "MERGE"

View File

@ -1,12 +1,14 @@
#!/bin/sh
NAMECHEAP_API_KEY=$(pass namecheap.com/api_key)
LINODE_TOKEN=$(pass linode.com/token)
VULTR_API_KEY=$(pass vultr.com/api_key)
export HTTP_PROXY=caladan:8888
export HTTPS_PROXY=caladan:8888
NAMECHEAP_API_KEY=$(pass namecheap.com/api_key)
export NAMECHEAP_API_KEY
LINODE_TOKEN=$(pass linode.com/token)
export LINODE_TOKEN
export VULTR_API_KEY
terraform "$@"