feat: Created post-install script
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
resource "hcloud_firewall" "this" {
|
||||
name = "dev-firewall"
|
||||
|
||||
rule { # server ssh
|
||||
rule { # server ssh - wired to the vpn server's public IP only, see infra/main.tf
|
||||
direction = "in"
|
||||
protocol = "tcp"
|
||||
port = "22"
|
||||
@@ -61,6 +61,25 @@ resource "hcloud_server" "this" {
|
||||
network_id = var.network_id
|
||||
ip = var.private_ip
|
||||
}
|
||||
|
||||
connection {
|
||||
type = "ssh"
|
||||
host = self.ipv4_address
|
||||
user = "root"
|
||||
private_key = file(var.ssh_private_key_path)
|
||||
}
|
||||
|
||||
provisioner "file" {
|
||||
content = var.bootstrap_script
|
||||
destination = "/root/bootstrap.sh"
|
||||
}
|
||||
|
||||
provisioner "remote-exec" {
|
||||
inline = [
|
||||
"chmod +x /root/bootstrap.sh",
|
||||
"/root/bootstrap.sh",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
resource "hcloud_volume" "storage" {
|
||||
|
||||
Reference in New Issue
Block a user