Move configuration of servers completely to ansible
With this change we no longer use user-data scripts on the provided machines. That makes it way easier for me to handle all the configuration, since I only have to run ansible. Furthermore this the burdon to think what may went wrong, since ansible is easier to debug than some arbitrary scripts which run at provisioning-time on the machines. With this change I should also think about restructuring the code a bit as well. Since it's actually easier to provide the initial software-stack for the cluster via ansible than via terraform, at least as far as I can tell right now.
This commit is contained in:
@@ -89,14 +89,6 @@ resource "hcloud_server" "server" {
|
||||
network_id = hcloud_network.this.id
|
||||
ip = each.value.ip
|
||||
}
|
||||
user_data = templatefile(
|
||||
"${path.module}/server-init.yaml.tftpl",
|
||||
{
|
||||
network_ip_range = local.network
|
||||
k3s_token = random_string.k3s_token.result
|
||||
first_ip = each.value.first_ip
|
||||
}
|
||||
)
|
||||
firewall_ids = [for firewall in hcloud_firewall.this : firewall.id]
|
||||
}
|
||||
|
||||
@@ -121,13 +113,4 @@ resource "hcloud_server" "agent" {
|
||||
network_id = hcloud_network.this.id
|
||||
ip = each.value.ip
|
||||
}
|
||||
user_data = templatefile(
|
||||
"${path.module}/agent-init.yaml.tftpl",
|
||||
{
|
||||
server_ip = cidrhost(local.subnet_eu_central, 2)
|
||||
network_gateway = cidrhost(local.subnet_eu_central, 1)
|
||||
dns_servers = "8.8.8.8 8.8.4.4"
|
||||
k3s_token = random_string.k3s_token.result
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user