mirror of
https://github.com/2martens/terraform.git
synced 2026-10-17 14:36:50 +02:00
change: Only install certbot on manager nodes
This commit is contained in:
@@ -77,7 +77,9 @@ resource "hcloud_server" "node" {
|
||||
terraform_public_ssh_key : var.terraform_public_ssh_key
|
||||
github_public_ssh_key : var.github_public_ssh_key
|
||||
main_node : count.index == 0
|
||||
packages_setup : base64encode(file("${path.module}/templates/scripts/install-packages.sh"))
|
||||
packages_setup : base64encode(templatefile("${path.module}/templates/scripts/install-packages.sh.tftpl", {
|
||||
manager_node : true
|
||||
}))
|
||||
firewall_setup : base64encode(templatefile("${path.module}/templates/scripts/firewall-setup.sh.tftpl", {
|
||||
node_ip : var.private_node_ips[count.index]
|
||||
manager_node : true
|
||||
|
||||
@@ -75,7 +75,9 @@ resource "hcloud_server" "worker_node" {
|
||||
admin_public_ssh_key : format("%s %s", var.admin_ssh_key.public_key, var.admin_ssh_key.name)
|
||||
admin_user : var.admin_user
|
||||
terraform_public_ssh_key : var.terraform_public_ssh_key
|
||||
packages_setup : base64encode(file("${path.module}/templates/scripts/install-packages.sh"))
|
||||
packages_setup : base64encode(templatefile("${path.module}/templates/scripts/install-packages.sh.tftpl", {
|
||||
manager_node : false
|
||||
}))
|
||||
firewall_setup : base64encode(templatefile("${path.module}/templates/scripts/firewall-setup.sh.tftpl", {
|
||||
node_ip : var.private_node_ips[count.index]
|
||||
manager_node : false
|
||||
|
||||
+3
-1
@@ -10,7 +10,7 @@ chmod a+r /etc/apt/keyrings/docker.asc
|
||||
# Add the repository to Apt sources:
|
||||
echo \
|
||||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
|
||||
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
|
||||
$(. /etc/os-release && echo "$${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
|
||||
tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
apt-get update
|
||||
|
||||
@@ -22,4 +22,6 @@ apt-get -y install ufw
|
||||
curl https://packages.hetzner.com/hcloud/deb/hc-utils_0.0.4-1_all.deb -o /run/tmpfiles.d/hc-utils_0.0.4-1_all.deb -s
|
||||
apt-get -y install /run/tmpfiles.d/hc-utils_0.0.4-1_all.deb
|
||||
|
||||
%{if manager_node ~}
|
||||
apt-get -y install certbot
|
||||
%{endif ~}
|
||||
Reference in New Issue
Block a user