feat: Created post-install script
This commit is contained in:
@@ -38,4 +38,23 @@ resource "hcloud_server" "this" {
|
||||
location = var.location
|
||||
ssh_keys = [var.ssh_key_id]
|
||||
firewall_ids = [hcloud_firewall.this.id]
|
||||
|
||||
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",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user