feat(dns): import ovh opytex registrations

This commit is contained in:
2025-11-30 17:43:45 +01:00
parent c9e7e8b27c
commit 4e2bd3a448
7 changed files with 299 additions and 12 deletions

View File

@@ -42,3 +42,25 @@ provider "registry.opentofu.org/gmichels/adguard" {
"zh:f809ab383cca0a5f83072981c64208cbd7fa67e986a86ee02dd2c82333221e32",
]
}
provider "registry.opentofu.org/ovh/ovh" {
version = "2.10.0"
constraints = "~> 2.10"
hashes = [
"h1:6CHM/tHZ7vAvQKtdqurs6ExO+46gpFooZ0zdaW74DKE=",
"zh:1582485c59b5e25fa407417de3040dfc31bfec3f9b884d51953f6625b930d2f6",
"zh:15b425716d5e05992cb1d68a49d58f0e9e0cbd7dbaa35ea9793404fa1ec45bed",
"zh:1c1547ff469c2f772d478f67d148d08b38468d43c9517b723b622a085625d949",
"zh:2491be291a8876da2dc1e71490428706cdca39002a1e89d10dd060474f59ce19",
"zh:2d9c7589764f838f04d38a87a0e6c9db6b560b6c5b510b69eabf2d67caa38d2b",
"zh:56c5b16a55dc4ac5f3eed69072e5ae74aafac2a4a8a84ba27fa06528320037cc",
"zh:629d2c7f709fc01adabba1c8b98ec7485dfebcc4b9f72f4bd4d36509166eb42c",
"zh:82f4b8b35a31a468d7a2a5aa4630f432ef64d9abfed8066afdaab0502886a72a",
"zh:84c5e65122efaee5e34c266cd750576969bd788c2bdbb804a7ffc08728ac3987",
"zh:85db08f3e1b27fda723b080bc5132069b6b7ba9699567cd44fb0a2207456a76c",
"zh:a84c043c96a01230e570163706f58c33ee59699fcc857d3db0f6e0b2a6b08bc6",
"zh:ad984516009930efc6ec465046287c6b293b6b219e3167aa4c0b900b903c6a50",
"zh:bd0114d45ec72134cf930a7619b70b0068e439759febba5717abb76219b85800",
"zh:f243a50dcf87687881972fcaba9226b4247588b6dc7368b0ef98168f643ee159",
]
}

View File

@@ -1,15 +1,3 @@
terraform {
required_providers {
adguard = {
source = "gmichels/adguard"
version = "~> 1.0"
}
pass = {
source = "camptocamp/pass"
version = "~> 2.0"
}
}
}
data "pass_password" "adguard" {
path = var.adguard_pass_path

21
dns/ovh.conf.example Normal file
View File

@@ -0,0 +1,21 @@
# Configuration pour l'API OVH
# Copiez ce fichier vers ovh.conf et remplissez vos credentials
# Votre nom de domaine OVH
ZONE="votredomaine.com"
# Endpoint OVH (ovh-eu pour Europe, ovh-ca pour Canada)
OVH_ENDPOINT="ovh-eu"
# Credentials de l'API OVH
# Pour créer ces credentials, visitez: https://eu.api.ovh.com/createToken/
#
# Droits nécessaires:
# GET /domain/zone/*
# POST /domain/zone/* (optionnel, pour créer des enregistrements)
# PUT /domain/zone/* (optionnel, pour modifier des enregistrements)
# DELETE /domain/zone/* (optionnel, pour supprimer des enregistrements)
OVH_APPLICATION_KEY="votre_application_key"
OVH_APPLICATION_SECRET="votre_application_secret"
OVH_CONSUMER_KEY="votre_consumer_key"

10
dns/ovh.tf Normal file
View File

@@ -0,0 +1,10 @@
data "pass_password" "ovh" {
path = var.ovh_pass_path
}
provider "ovh" {
endpoint = "ovh-eu"
application_key = data.pass_password.ovh.data.ak
application_secret = data.pass_password.ovh.data.as
consumer_key = data.pass_password.ovh.data.ck
}

223
dns/ovh_opytex_records.tf Normal file
View File

@@ -0,0 +1,223 @@
resource "ovh_domain_zone_record" "git_a" {
zone = "opytex.org"
subdomain = "git"
fieldtype = "A"
ttl = 3600
target = "188.165.240.182"
}
resource "ovh_domain_zone_record" "root_a" {
zone = "opytex.org"
subdomain = ""
fieldtype = "A"
ttl = 3600
target = "188.165.240.182"
}
resource "ovh_domain_zone_record" "raw_a" {
zone = "opytex.org"
subdomain = "raw"
fieldtype = "A"
ttl = 3600
target = "188.165.240.182"
}
resource "ovh_domain_zone_record" "www_cname" {
zone = "opytex.org"
subdomain = "www"
fieldtype = "CNAME"
ttl = 3600
target = "opytex.org."
}
resource "ovh_domain_zone_record" "ftp_cname" {
zone = "opytex.org"
subdomain = "ftp"
fieldtype = "CNAME"
ttl = 3600
target = "opytex.org."
}
resource "ovh_domain_zone_record" "admin_a" {
zone = "opytex.org"
subdomain = "admin"
fieldtype = "A"
ttl = 3600
target = "91.121.90.228"
}
resource "ovh_domain_zone_record" "storage_a" {
zone = "opytex.org"
subdomain = "storage"
fieldtype = "A"
ttl = 3600
target = "188.165.240.182"
}
resource "ovh_domain_zone_record" "minio_a" {
zone = "opytex.org"
subdomain = "minio"
fieldtype = "A"
ttl = 3600
target = "188.165.240.182"
}
resource "ovh_domain_zone_record" "chioggia_a" {
zone = "opytex.org"
subdomain = "chioggia"
fieldtype = "A"
ttl = 3600
target = "188.165.240.182"
}
resource "ovh_domain_zone_record" "chioggia_aaaa" {
zone = "opytex.org"
subdomain = "chioggia"
fieldtype = "AAAA"
ttl = 3600
target = "2001:41d0:2:bbb6:0:0:0:1"
}
resource "ovh_domain_zone_record" "sso_a" {
zone = "opytex.org"
subdomain = "sso"
fieldtype = "A"
ttl = 3600
target = "188.165.240.182"
}
resource "ovh_domain_zone_record" "rss_a" {
zone = "opytex.org"
subdomain = "rss"
fieldtype = "A"
ttl = 3600
target = "188.165.240.182"
}
resource "ovh_domain_zone_record" "rss_aaaa" {
zone = "opytex.org"
subdomain = "rss"
fieldtype = "AAAA"
ttl = 3600
target = "2001:41d0:2:bbb6:0:0:0:1"
}
resource "ovh_domain_zone_record" "bag_a" {
zone = "opytex.org"
subdomain = "bag"
fieldtype = "A"
ttl = 3600
target = "188.165.240.182"
}
resource "ovh_domain_zone_record" "bag_aaaa" {
zone = "opytex.org"
subdomain = "bag"
fieldtype = "AAAA"
ttl = 3600
target = "2001:41d0:2:bbb6:0:0:0:1"
}
resource "ovh_domain_zone_record" "liens_a" {
zone = "opytex.org"
subdomain = "liens"
fieldtype = "A"
ttl = 3600
target = "188.165.240.182"
}
resource "ovh_domain_zone_record" "liens_aaaa" {
zone = "opytex.org"
subdomain = "liens"
fieldtype = "AAAA"
ttl = 3600
target = "2001:41d0:2:bbb6:0:0:0:1"
}
resource "ovh_domain_zone_record" "storage_aaaa" {
zone = "opytex.org"
subdomain = "storage"
fieldtype = "AAAA"
ttl = 3600
target = "2001:41d0:2:bbb6:0:0:0:1"
}
resource "ovh_domain_zone_record" "minio_aaaa" {
zone = "opytex.org"
subdomain = "minio"
fieldtype = "AAAA"
ttl = 3600
target = "2001:41d0:2:bbb6:0:0:0:1"
}
resource "ovh_domain_zone_record" "git_aaaa" {
zone = "opytex.org"
subdomain = "git"
fieldtype = "AAAA"
ttl = 3600
target = "2001:41d0:2:bbb6:0:0:0:1"
}
resource "ovh_domain_zone_record" "paperless_a" {
zone = "opytex.org"
subdomain = "paperless"
fieldtype = "A"
ttl = 3600
target = "188.165.240.182"
}
resource "ovh_domain_zone_record" "paperless_aaaa" {
zone = "opytex.org"
subdomain = "paperless"
fieldtype = "AAAA"
ttl = 3600
target = "2001:41d0:2:bbb6:0:0:0:1"
}
resource "ovh_domain_zone_record" "grafana_a" {
zone = "opytex.org"
subdomain = "grafana"
fieldtype = "A"
ttl = 3600
target = "188.165.240.182"
}
resource "ovh_domain_zone_record" "grafana_aaaa" {
zone = "opytex.org"
subdomain = "grafana"
fieldtype = "AAAA"
ttl = 3600
target = "2001:41d0:2:bbb6:0:0:0:1"
}
resource "ovh_domain_zone_record" "photos_a" {
zone = "opytex.org"
subdomain = "photos"
fieldtype = "A"
ttl = 3600
target = "188.165.240.182"
}
resource "ovh_domain_zone_record" "photos_aaaa" {
zone = "opytex.org"
subdomain = "photos"
fieldtype = "AAAA"
ttl = 3600
target = "2001:41d0:2:bbb6:0:0:0:1"
}
resource "ovh_domain_zone_record" "vault_a" {
zone = "opytex.org"
subdomain = "vault"
fieldtype = "A"
ttl = 3600
target = "188.165.240.182"
}
resource "ovh_domain_zone_record" "vault_aaaa" {
zone = "opytex.org"
subdomain = "vault"
fieldtype = "AAAA"
ttl = 3600
target = "2001:41d0:2:bbb6:0:0:0:1"
}

17
dns/providers.tf Normal file
View File

@@ -0,0 +1,17 @@
terraform {
required_providers {
adguard = {
source = "gmichels/adguard"
version = "~> 1.0"
}
pass = {
source = "camptocamp/pass"
version = "~> 2.0"
}
ovh = {
source = "ovh/ovh"
version = "~> 2.10"
}
}
}

View File

@@ -1,3 +1,9 @@
variable "ovh_pass_path" {
type = string
description = "Path in pass for ovh dns tf creds"
default = "OVH/bb17629-ovh/tf-dns"
}
variable "adguard_pass_path" {
type = string
description = "Path in pass for AdGuard username"