Compare commits
5 Commits
263c78bfe7
...
549ae38af5
Author | SHA1 | Date |
---|---|---|
Ricard Illa | 549ae38af5 | |
Ricard Illa | 4d3f5a73da | |
Ricard Illa | ba82b59482 | |
Ricard Illa | fc63c2f1d2 | |
Ricard Illa | dd2e9e1800 |
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
4
main.tf
4
main.tf
|
@ -5,5 +5,9 @@ terraform {
|
|||
source = "namecheap/namecheap"
|
||||
version = ">= 2.0.0"
|
||||
}
|
||||
linode = {
|
||||
source = "linode/linode"
|
||||
version = ">= 1.29.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 "$@"
|
||||
|
|
Loading…
Reference in New Issue