Goodbye Contabo
This commit is contained in:
parent
56885d70b6
commit
428de8040a
8 changed files with 7 additions and 76 deletions
|
@ -7,11 +7,6 @@ hosts = {
|
|||
server_type = "cx32"
|
||||
datacenter = "fsn1-dc14"
|
||||
},
|
||||
"node002" = {
|
||||
hostname = "node002"
|
||||
rdns = "node002.serguzim.net"
|
||||
provider = "contabo"
|
||||
},
|
||||
"node003" = {
|
||||
hostname = "node003"
|
||||
rdns = "mail.serguzim.me"
|
||||
|
|
|
@ -3,7 +3,6 @@ all:
|
|||
serguzim_net:
|
||||
hosts:
|
||||
node001:
|
||||
node002:
|
||||
node003:
|
||||
hosts:
|
||||
local-dev:
|
||||
|
@ -22,19 +21,6 @@ all:
|
|||
hc_url: "{{ opentofu.healthchecksio.backup.node001.ping_url }}"
|
||||
gatus_token: "{{ vault_hosts.node001.backup.gatus_token }}"
|
||||
|
||||
node002:
|
||||
ansible_host: "{{ opentofu.hosts.node002.fqdn_vpn }}"
|
||||
ansible_port: "{{ vault_hosts.node002.ansible_port }}"
|
||||
ansible_user: "{{ vault_hosts.node002.ansible_user }}"
|
||||
interactive_user: "{{ vault_hosts.node002.interactive_user }}"
|
||||
host_vpn:
|
||||
domain: "{{ opentofu.hosts.node002.fqdn_vpn }}"
|
||||
ip: "{{ opentofu.hosts.node002.ipv4_address_vpn }}"
|
||||
host_backup:
|
||||
hc_uid: "{{ opentofu.healthchecksio.backup.node002.id }}"
|
||||
hc_url: "{{ opentofu.healthchecksio.backup.node002.ping_url }}"
|
||||
gatus_token: "{{ vault_hosts.node002.backup.gatus_token }}"
|
||||
|
||||
node003:
|
||||
ansible_host: "{{ opentofu.hosts.node003.fqdn_vpn }}"
|
||||
ansible_port: "{{ vault_hosts.node003.ansible_port }}"
|
||||
|
|
11
main.tf
11
main.tf
|
@ -4,10 +4,6 @@ terraform {
|
|||
source = "hashicorp/aws"
|
||||
version = "~> 5.0"
|
||||
}
|
||||
contabo = {
|
||||
source = "contabo/contabo"
|
||||
version = "~> 0.1.26"
|
||||
}
|
||||
hcloud = {
|
||||
source = "hetznercloud/hcloud"
|
||||
version = "~> 1.45.0"
|
||||
|
@ -83,13 +79,6 @@ provider "aws" {
|
|||
secret_key = var.aws_secret_key
|
||||
}
|
||||
|
||||
provider "contabo" {
|
||||
oauth2_client_id = var.contabo_client_id
|
||||
oauth2_client_secret = var.contabo_client_secret
|
||||
oauth2_user = var.contabo_user
|
||||
oauth2_pass = var.contabo_pass
|
||||
}
|
||||
|
||||
provider "hcloud" {
|
||||
token = var.hcloud_token
|
||||
}
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
resource "contabo_instance" "nodes" {
|
||||
for_each = local.contabo_hosts
|
||||
display_name = each.value.hostname
|
||||
}
|
|
@ -4,10 +4,6 @@ terraform {
|
|||
source = "hashicorp/aws"
|
||||
version = "~> 5.0"
|
||||
}
|
||||
contabo = {
|
||||
source = "contabo/contabo"
|
||||
version = "~> 0.1.26"
|
||||
}
|
||||
hcloud = {
|
||||
source = "hetznercloud/hcloud"
|
||||
version = "~> 1.45.0"
|
||||
|
@ -37,6 +33,5 @@ locals {
|
|||
services_database = {for key, val in var.services : key => val if val.database}
|
||||
services_s3 = {for key, val in var.services : key => val if val.s3}
|
||||
|
||||
contabo_hosts = {for key, val in var.hosts : key => val if val.provider == "contabo"}
|
||||
hetzner_hosts = {for key, val in var.hosts : key => val if val.provider == "hetzner"}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,5 @@
|
|||
locals {
|
||||
server_addresses = flatten([
|
||||
[
|
||||
for key, host in contabo_instance.nodes : [
|
||||
{
|
||||
key = key
|
||||
hostname = host.display_name
|
||||
ipv4_address = host.ip_config[0].v4[0].ip
|
||||
ipv6_address = host.ip_config[0].v6[0].ip
|
||||
},
|
||||
]
|
||||
],
|
||||
[
|
||||
for key, host in hcloud_server.nodes : [
|
||||
{
|
||||
key = key
|
||||
|
@ -19,7 +8,6 @@ locals {
|
|||
ipv6_address = host.ipv6_address
|
||||
},
|
||||
]
|
||||
]
|
||||
])
|
||||
|
||||
server_addresses_separated = merge([
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
apply:
|
||||
tags: software
|
||||
tags: software
|
||||
when: "inventory_hostname != 'node002'"
|
||||
|
||||
- name: Run always role
|
||||
ansible.builtin.include_role:
|
||||
|
|
17
variables.tf
17
variables.tf
|
@ -45,23 +45,6 @@ variable "aws_secret_key" {
|
|||
}
|
||||
|
||||
|
||||
variable "contabo_client_id" {
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "contabo_client_secret" {
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "contabo_user" {
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "contabo_pass" {
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
|
||||
variable "hcloud_token" {
|
||||
sensitive = true
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue