This commit is contained in:
@@ -48,15 +48,23 @@ resource "proxmox_lxc" "staging" {
|
||||
|
||||
provisioner "remote-exec" {
|
||||
inline = [
|
||||
# Root Password setzen
|
||||
"echo 'root:${var.root_password}' | chpasswd",
|
||||
|
||||
# System Setup
|
||||
"apt-get update -qq",
|
||||
"apt-get install -y hugo nginx git rsync curl",
|
||||
"systemctl enable --now nginx",
|
||||
|
||||
# Deploy User mit SSH Key
|
||||
"useradd -m -s /bin/bash deploy || true",
|
||||
"mkdir -p /home/deploy/.ssh",
|
||||
"chmod 700 /home/deploy/.ssh",
|
||||
"echo '${var.ssh_public_key}' >> /home/deploy/.ssh/authorized_keys",
|
||||
"chmod 600 /home/deploy/.ssh/authorized_keys",
|
||||
"chown -R deploy:deploy /home/deploy/.ssh",
|
||||
|
||||
# Web Root
|
||||
"mkdir -p /var/www/html",
|
||||
"chown -R deploy:deploy /var/www/html"
|
||||
]
|
||||
@@ -65,6 +73,8 @@ resource "proxmox_lxc" "staging" {
|
||||
user = "root"
|
||||
private_key = var.ssh_private_key
|
||||
host = self.network[0].ip
|
||||
timeout = "10m"
|
||||
agent = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user