Compare commits

...

5 Commits

Author SHA1 Message Date
Ricard Illa 549ae38af5
add caladan vm 2022-08-24 18:27:37 +02:00
Ricard Illa 4d3f5a73da
added linode provider 2022-08-24 18:07:33 +02:00
Ricard Illa ba82b59482
add comment mentioning DNSSEC 2022-08-24 17:32:22 +02:00
Ricard Illa fc63c2f1d2
set email_type to MX 2022-08-24 17:30:30 +02:00
Ricard Illa dd2e9e1800
ci: terraform apply 2022-08-24 12:05:55 +02:00
5 changed files with 65 additions and 8 deletions

View File

@ -2,6 +2,12 @@ platform: linux/arm64
pipeline:
# gitleaks:
# image: registry.monotremata.xyz/gitleaks
# pull: true
# commands:
# - gitleaks --source . --verbose --redact detect
init:
image: registry.monotremata.xyz/terraform
pull: true
@ -19,13 +25,19 @@ pipeline:
environment:
- HTTP_PROXY=caladan:8888
- HTTPS_PROXY=caladan:8888
secrets: [namecheap_api_key]
secrets:
- linode_token
- namecheap_api_key
# gitleaks:
# image: registry.monotremata.xyz/gitleaks
# pull: true
# commands:
# - gitleaks --source . --verbose --redact detect
apply:
image: registry.monotremata.xyz/terraform
pull: true
commands:
- terraform apply tfplan
environment:
- HTTP_PROXY=caladan:8888
- HTTPS_PROXY=caladan:8888
secrets: [namecheap_api_key]
notify:
image: registry.monotremata.xyz/xmpp-ci

33
linode.tf Normal file
View File

@ -0,0 +1,33 @@
provider "linode" {
}
# https://www.linode.com/docs/guides/import-existing-infrastructure-to-terraform/
resource "linode_instance" "caladan-vm" {
label = "caladan"
region = "eu-central"
type = "g6-nanode-1"
config {
label = "My Alpine 3.13 Disk Profile"
kernel = "linode/grub2"
root_device = "/dev/sda"
devices {
sda {
disk_label = "Alpine 3.13 Disk"
}
sdb {
disk_label = "512 MB Swap Image"
}
}
}
disk {
label = "Alpine 3.13 Disk"
size = 25088
}
disk {
label = "512 MB Swap Image"
size = 512
}
}

View File

@ -5,5 +5,9 @@ terraform {
source = "namecheap/namecheap"
version = ">= 2.0.0"
}
linode = {
source = "linode/linode"
version = ">= 1.29.0"
}
}
}

View File

@ -33,6 +33,9 @@
//
// - A + Dynamic DNS Record:
// host: wg
//
// I also enable DNSSEC from the web UI, because I can't do that with
// terraform...
@ -132,8 +135,9 @@ provider "namecheap" {
}
resource "namecheap_domain_records" "monotremata-xyz" {
domain = "monotremata.xyz"
mode = "MERGE"
domain = "monotremata.xyz"
mode = "MERGE"
email_type = "MX"
dynamic "record" {
for_each = var.caladan-subdomains

View File

@ -2,7 +2,11 @@
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
terraform "$@"