From d98c7b8bdb87a14eff6eb0937cdef901a7eaccab Mon Sep 17 00:00:00 2001 From: JulienAldon Date: Wed, 14 Jan 2026 10:15:55 +0100 Subject: [PATCH] add bookshelf module, fix gitea minor typo, add fixe ip for vms --- README.md | 6 + main.tf | 42 ++-- modules/apps/bookshelf/.env.example | 20 ++ .../apps/bookshelf/cloud-init/service.yaml | 94 ++++++++ .../bookshelf/lib/scripts/create-backup.sh | 8 + modules/apps/bookshelf/lib/scripts/env.sh | 4 + .../lib/scripts/install-bookshelf.sh | 38 ++++ .../bookshelf/lib/scripts/install-runner.sh | 59 +++++ .../bookshelf/lib/scripts/restore-backup.sh | 9 + .../bookshelf/lib/services/act_runner.service | 16 ++ .../lib/services/restore-backup.service | 11 + .../lib/services/weekly-backup.service | 10 + .../lib/services/weekly-backup.timer | 9 + modules/apps/bookshelf/main.tf | 38 ++++ modules/apps/bookshelf/variables.tf | 52 +++++ modules/apps/gitea/install.sh | 209 ------------------ .../apps/gitea/lib/scripts/install-gitea.sh | 3 + modules/apps/gitea/main.tf | 1 + modules/vm/main.tf | 7 + modules/vm/variables.tf | 4 + 20 files changed, 410 insertions(+), 230 deletions(-) create mode 100644 modules/apps/bookshelf/.env.example create mode 100644 modules/apps/bookshelf/cloud-init/service.yaml create mode 100644 modules/apps/bookshelf/lib/scripts/create-backup.sh create mode 100644 modules/apps/bookshelf/lib/scripts/env.sh create mode 100644 modules/apps/bookshelf/lib/scripts/install-bookshelf.sh create mode 100644 modules/apps/bookshelf/lib/scripts/install-runner.sh create mode 100644 modules/apps/bookshelf/lib/scripts/restore-backup.sh create mode 100644 modules/apps/bookshelf/lib/services/act_runner.service create mode 100644 modules/apps/bookshelf/lib/services/restore-backup.service create mode 100644 modules/apps/bookshelf/lib/services/weekly-backup.service create mode 100644 modules/apps/bookshelf/lib/services/weekly-backup.timer create mode 100644 modules/apps/bookshelf/main.tf create mode 100644 modules/apps/bookshelf/variables.tf delete mode 100644 modules/apps/gitea/install.sh diff --git a/README.md b/README.md index d0ff6fc..1f22212 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,12 @@ opentofu.tofu plan opentofu.tofu apply opentofu.tofu destroy ``` + +### SOPS for .env and secret management +```sh +sops -e modules/apps//.env > modules/apps//.env.enc +``` + ### On WSL ssh agent could be off if `ssh-add -L` gives diff --git a/main.tf b/main.tf index 9ad1604..d753def 100644 --- a/main.tf +++ b/main.tf @@ -18,27 +18,6 @@ provider "proxmox" { } } -# module "bookshelf" { -# source = "./modules/vm" - -# providers = {} - -# name = "bookshelf" -# hostname = "bookshelf" -# domain = "aldon.fr" -# vm_id = 210 -# node_name = "mop" - -# template_id = 103 - -# cores = 1 -# memory = 1024 -# disk_size = 16 - -# ssh_public_key = var.ssh_public_key -# proxmox_host_ip = var.proxmox_host_ip -# } - module "gitea" { source = "./modules/apps/gitea" providers = {} @@ -58,3 +37,24 @@ module "gitea" { ssh_public_key = var.ssh_public_key proxmox_host_ip = var.proxmox_host_ip } + + +module "bookshelf" { + source = "./modules/apps/bookshelf" + providers = {} + + name = "bookshelf" + hostname = "bookshelf" + domain = "aldon.fr" + vm_id = 211 + node_name = "mop" + + template_id = 103 + + cores = 1 + memory = 1024 + disk_size = 16 + + ssh_public_key = var.ssh_public_key + proxmox_host_ip = var.proxmox_host_ip +} diff --git a/modules/apps/bookshelf/.env.example b/modules/apps/bookshelf/.env.example new file mode 100644 index 0000000..4aa9763 --- /dev/null +++ b/modules/apps/bookshelf/.env.example @@ -0,0 +1,20 @@ +ACT_RUNNER_VERSION=0.2.13 +ACT_RUNNER_LOCATION=/usr/local/bin +ACT_RUNNER_USER=act_runner +ENV_FILE_LOCATION=/opt/bookshelf/secrets/bookshelf.env +GITEA_INSTANCE_URL=https://gitea.aldon.fr +GITEA_RUNNER_REGISTRATION_TOKEN= +GITEA_BOOKSHELF_APPLICATION_TOKEN= +GITEA_BOOKSHELF_REPOSITORY=mop/bookshelf + +USERNAME=bookshelf +BOOKSHELF_BACKUPS_DIR=/backups/bookshelf +BOOKSHELF_BACKUP_PREFIX=bookshelf-dump + +MARIADB_USER=bookshelf +MARIADB_PASSWORD= +MARIADB_DATABASE=Biblio +MARIADB_ROOT_PASSWORD= +SERVICE_SECRET_KEY= +SERVICE_ORIGIN=https://bookshelf.aldon.fr +SERVICE_ROOT_FQDN=https://bookshelf.aldon.fr/api \ No newline at end of file diff --git a/modules/apps/bookshelf/cloud-init/service.yaml b/modules/apps/bookshelf/cloud-init/service.yaml new file mode 100644 index 0000000..811737b --- /dev/null +++ b/modules/apps/bookshelf/cloud-init/service.yaml @@ -0,0 +1,94 @@ +#cloud-config +hostname: ${hostname} +local-hostname: ${hostname} +fqdn: ${hostname}.${domain} +manage_etc_hosts: true + +users: + - default + - name: ${hostname} + groups: sudo + shell: /bin/bash + sudo: ALL=(ALL) NOPASSWD:ALL + ssh_authorized_keys: + - ${ssh_key} + +disable_root: true + +package_update: true +package_upgrade: false + +packages: + - git + - nfs-common + - docker.io + - docker-compose + - curl + - jq + +write_files: + - path: /etc/fstab + permissions: "0644" + content: | + ${proxmox_host_ip}:/main/backups /backups nfs defaults,_netdev,x-systemd.requires=network-online.target 0 0 + - path: /opt/bookshelf/env.sh + permissions: "0644" + content: | + ${environment-setup-script} + - path: /opt/bookshelf/secrets/bookshelf.env + permissions: "0644" + content: | + ${env-file-content} + - path: /usr/local/bin/restore-backup.sh + permissions: "0755" + content: | + ${restore-backup-script} + - path: /etc/systemd/system/restore-backup.service + permissions: "0644" + content: | + ${restore-backup-service} + - path: /usr/local/bin/backup.sh + permissions: "0755" + content: | + ${create-backup-script} + - path: /etc/systemd/system/weekly-backup.timer + permissions: "0644" + content: | + ${create-backup-timer} + - path: /etc/systemd/system/weekly-backup.service + permissions: "0644" + content: | + ${create-backup-service} + - path: /etc/systemd/system/act_runner.service + permissions: "0644" + content: | + ${act_runner-service} + - path: /opt/bookshelf/install-runner.sh + permissions: "0755" + content: | + ${act_runner-install-script} + - path: /opt/bookshelf/install-bookshelf.sh + permissions: "0755" + content: | + ${bookshelf-install-script} + +runcmd: + # Backup setup + - mkdir -p /backups + - mount -t nfs ${proxmox_host_ip}:/main/backups /backups + - systemctl enable --now weekly-backup.timer + # Docker setup + - systemctl enable docker + - systemctl start docker + - usermod -aG docker ${hostname} + # Act_runner install + - /opt/bookshelf/install-runner.sh + - systemctl daemon-reload + - systemctl enable act_runner.service + - systemctl start act_runner.service + # Bookshelf install + - /opt/bookshelf/install-bookshelf.sh + + +final_message: | + Base system ready for ${hostname} \ No newline at end of file diff --git a/modules/apps/bookshelf/lib/scripts/create-backup.sh b/modules/apps/bookshelf/lib/scripts/create-backup.sh new file mode 100644 index 0000000..e55d86b --- /dev/null +++ b/modules/apps/bookshelf/lib/scripts/create-backup.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +source /opt/bookshelf/env.sh + +TIMESTAMP=$(date +'%Y-%m-%d_%H%M%S') +docker exec bookshelf-database-1 mariadb-dump --all-database -u root -p"$MARIADB_ROOT_PASSWORD" > $BOOKSHELF_BACKUPS_DIR/bookshelf-dump-$TIMESTAMP.sql + +ls -1dt $BOOKSHELF_BACKUPS_DIR/$BOOKSHELF_BACKUP_PREFIX-*.zip | tail -n +5 | xargs -r rm -f diff --git a/modules/apps/bookshelf/lib/scripts/env.sh b/modules/apps/bookshelf/lib/scripts/env.sh new file mode 100644 index 0000000..3fa8dbb --- /dev/null +++ b/modules/apps/bookshelf/lib/scripts/env.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -a +[ -f /opt/bookshelf/secrets/bookshelf.env ] && source /opt/bookshelf/secrets/bookshelf.env +set +a \ No newline at end of file diff --git a/modules/apps/bookshelf/lib/scripts/install-bookshelf.sh b/modules/apps/bookshelf/lib/scripts/install-bookshelf.sh new file mode 100644 index 0000000..1f9ef39 --- /dev/null +++ b/modules/apps/bookshelf/lib/scripts/install-bookshelf.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +source /opt/bookshelf/env.sh + +# trigger manually a CI/CD pipeline +curl -X POST -H "Authorization: token $GITEA_BOOKSHELF_APPLICATION_TOKEN" \ + -H "Content-Type: application/json" \ + $GITEA_INSTANCE_URL/api/v1/repos/$GITEA_BOOKSHELF_REPOSITORY/actions/workflows/deploy.yaml/dispatches \ + -d '{"ref": "main", "inputs": {"ref": "main"}}' + +RUN_ID=$(curl -s -H "Authorization: token $GITEA_BOOKSHELF_APPLICATION_TOKEN" \ + $GITEA_INSTANCE_URL/api/v1/repos/$GITEA_BOOKSHELF_REPOSITORY/actions/runs \ + | jq -r '.workflow_runs | sort_by(.created_at) | .[0].id') + +while true; do + STATUS=$(curl -s -H "Authorization: token $GITEA_BOOKSHELF_APPLICATION_TOKEN" \ + $GITEA_INSTANCE_URL/api/v1/repos/$GITEA_BOOKSHELF_REPOSITORY/actions/runs/$RUN_ID \ + | jq -r '.status') + + if [ "$STATUS" = "completed" ]; then + CONCLUSION=$(curl -s -H "Authorization: token $GITEA_BOOKSHELF_APPLICATION_TOKEN" \ + $GITEA_INSTANCE_URL/api/v1/repos/$GITEA_BOOKSHELF_REPOSITORY/actions/runs/$RUN_ID \ + | jq -r '.conclusion') + echo "Workflow finished with status: $CONCLUSION" + break + fi + + echo "Waiting 10 seconds..." + sleep 10 +done + +if [ "$CONCLUSION" = "success" ]; then + echo "Launching command..." + systemctl start restore-backup.service +else + echo "Workflow failed or was cancelled, aborting." + exit 1 +fi \ No newline at end of file diff --git a/modules/apps/bookshelf/lib/scripts/install-runner.sh b/modules/apps/bookshelf/lib/scripts/install-runner.sh new file mode 100644 index 0000000..a70cc15 --- /dev/null +++ b/modules/apps/bookshelf/lib/scripts/install-runner.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +source /opt/bookshelf/env.sh + +if ! id -u $ACT_RUNNER_USER >/dev/null 2>&1; then + adduser \ + --system \ + --shell /bin/bash \ + --gecos 'Action runner user' \ + --ingroup docker\ + --disabled-password \ + --home /home/$ACT_RUNNER_USER \ + $ACT_RUNNER_USER +fi + +wget -O $ACT_RUNNER_LOCATION/act_runner https://dl.gitea.com/act_runner/$ACT_RUNNER_VERSION/act_runner-$ACT_RUNNER_VERSION-linux-amd64 +chmod +x $ACT_RUNNER_LOCATION/act_runner + +cat < /home/$ACT_RUNNER_USER/config.yaml +log: + level: info +runner: + file: .runner + capacity: 1 + timeout: 3h + shutdown_timeout: 0s + insecure: false + fetch_timeout: 5s + env_file: $ENV_FILE_LOCATION + fetch_interval: 2s + github_mirror: '' + labels: + - "ubuntu-latest:docker://docker.gitea.com/runner-images:ubuntu-latest" + - "ubuntu-22.04:docker://docker.gitea.com/runner-images:ubuntu-22.04" + - "ubuntu-20.04:docker://docker.gitea.com/runner-images:ubuntu-20.04" +cache: + enabled: true + dir: "" + host: "" + port: 0 + external_server: "" +container: + network: "" + privileged: false + options: + workdir_parent: + valid_volumes: [] + docker_host: "" + force_pull: true + force_rebuild: false + require_docker: false + docker_timeout: 0s +host: + workdir_parent: +EOF + +cd /home/act_runner +sudo -u $ACT_RUNNER_USER act_runner register --no-interactive --instance $GITEA_INSTANCE_URL --token $GITEA_RUNNER_REGISTRATION_TOKEN --name $USERNAME --labels $USERNAME $REPOSITORY +chown -R $ACT_RUNNER_USER:docker /home/$ACT_RUNNER_USER \ No newline at end of file diff --git a/modules/apps/bookshelf/lib/scripts/restore-backup.sh b/modules/apps/bookshelf/lib/scripts/restore-backup.sh new file mode 100644 index 0000000..0819dc1 --- /dev/null +++ b/modules/apps/bookshelf/lib/scripts/restore-backup.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +source /opt/bookshelf/env.sh + +LATEST_BACKUP=$(ls -1 $BOOKSHELF_BACKUPS_DIR/$BOOKSHELF_BACKUP_PREFIX-*.sql 2>/dev/null | sort | tail -n1) + +if [ -n "$LATEST_BACKUP" ] && [ -f "$LATEST_BACKUP" ]; then + cat $LATEST_BACKUP | docker exec -i bookshelf-database-1 mariadb -u root -p"$MARIADB_ROOT_PASSWORD" -D $MARIADB_DATABASE +fi \ No newline at end of file diff --git a/modules/apps/bookshelf/lib/services/act_runner.service b/modules/apps/bookshelf/lib/services/act_runner.service new file mode 100644 index 0000000..72043da --- /dev/null +++ b/modules/apps/bookshelf/lib/services/act_runner.service @@ -0,0 +1,16 @@ +[Unit] +Description=Gitea Actions runner +Documentation=https://gitea.com/gitea/act_runner +After=docker.service + +[Service] +ExecStart=/usr/local/bin/act_runner daemon --config /home/act_runner/config.yaml +ExecReload=/bin/kill -s HUP $MAINPID +WorkingDirectory=/home/act_runner +TimeoutSec=0 +RestartSec=10 +Restart=always +User=act_runner + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/modules/apps/bookshelf/lib/services/restore-backup.service b/modules/apps/bookshelf/lib/services/restore-backup.service new file mode 100644 index 0000000..6d4f6b5 --- /dev/null +++ b/modules/apps/bookshelf/lib/services/restore-backup.service @@ -0,0 +1,11 @@ +[Unit] +Description=Restore latest Bookshelf backup +After=network.target +Requires=docker.service + +[Service] +Type=oneshot +User=root +ExecStart=/usr/local/bin/restore-backup.sh +WorkingDirectory=/home/bookshelf +TimeoutStartSec=600 \ No newline at end of file diff --git a/modules/apps/bookshelf/lib/services/weekly-backup.service b/modules/apps/bookshelf/lib/services/weekly-backup.service new file mode 100644 index 0000000..03c3989 --- /dev/null +++ b/modules/apps/bookshelf/lib/services/weekly-backup.service @@ -0,0 +1,10 @@ +[Unit] +Description=Weekly Bookshelf Backup +Wants=network.target +After=network.target docker.service +Before=shutdown.target reboot.target halt.target + +[Service] +Type=oneshot +User=root +ExecStart=/usr/local/bin/backup.sh \ No newline at end of file diff --git a/modules/apps/bookshelf/lib/services/weekly-backup.timer b/modules/apps/bookshelf/lib/services/weekly-backup.timer new file mode 100644 index 0000000..bd996f4 --- /dev/null +++ b/modules/apps/bookshelf/lib/services/weekly-backup.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Run Bookshelf backup weekly + +[Timer] +OnCalendar=Sun *-*-* 01:00:00 +Persistent=true + +[Install] +WantedBy=timers.target \ No newline at end of file diff --git a/modules/apps/bookshelf/main.tf b/modules/apps/bookshelf/main.tf new file mode 100644 index 0000000..383067d --- /dev/null +++ b/modules/apps/bookshelf/main.tf @@ -0,0 +1,38 @@ +module "vm" { + source = "../../vm" + name = var.name + hostname = var.hostname + domain = var.domain + vm_id = var.vm_id + node_name = var.node_name + vm_ip_address = "192.168.1.91" + + template_id = var.template_id + + cores = var.cores + memory = var.memory + disk_size = var.disk_size + + ssh_public_key = var.ssh_public_key + proxmox_host_ip = var.proxmox_host_ip + cloudinit_config = templatefile( + "${path.module}/cloud-init/service.yaml", + { + hostname = var.hostname + domain = var.domain + ssh_key = var.ssh_public_key + proxmox_host_ip = var.proxmox_host_ip + environment-setup-script = indent(6, file("${path.module}/lib/scripts/env.sh")) + restore-backup-script = indent(6, file("${path.module}/lib/scripts/restore-backup.sh")) + restore-backup-service = indent(6, file("${path.module}/lib/services/restore-backup.service")) + create-backup-script = indent(6, file("${path.module}/lib/scripts/create-backup.sh")) + create-backup-service = indent(6, file("${path.module}/lib/services/weekly-backup.service")) + create-backup-timer = indent(6, file("${path.module}/lib/services/weekly-backup.timer")) + act_runner-service = indent(6, file("${path.module}/lib/services/act_runner.service")) + act_runner-install-script = indent(6, file("${path.module}/lib/scripts/install-runner.sh")) + bookshelf-install-script = indent(6, file("${path.module}/lib/scripts/install-bookshelf.sh")) + + env-file-content = indent(6, file("${path.module}/.env")) + } + ) +} \ No newline at end of file diff --git a/modules/apps/bookshelf/variables.tf b/modules/apps/bookshelf/variables.tf new file mode 100644 index 0000000..c837103 --- /dev/null +++ b/modules/apps/bookshelf/variables.tf @@ -0,0 +1,52 @@ +variable "name" { + type = string +} + +variable "vm_id" { + type = number +} + +variable "node_name" { + type = string + default = "mop" +} + +variable "cores" { + type = number + default = 2 +} + +variable "memory" { + type = number + default = 2048 +} + +variable "template_id" { + type = number +} + +variable "ssh_public_key" { + type = string + description = "Public SSH key for cloud-init user" +} + +variable "hostname" { + description = "VM hostname" + type = string + default = "test" +} + +variable "domain" { + description = "VM domain" + type = string + default = "" +} + +variable "disk_size" { + type = number + default = 10 +} + +variable "proxmox_host_ip" { + type = string +} \ No newline at end of file diff --git a/modules/apps/gitea/install.sh b/modules/apps/gitea/install.sh deleted file mode 100644 index eeb3880..0000000 --- a/modules/apps/gitea/install.sh +++ /dev/null @@ -1,209 +0,0 @@ -#!/bin/bash -set -euo pipefail - -sudo apt install postgresql postgresql-client unzip -y - -GITEA_HOME="/var/lib/gitea" -GITEA_CONF="$GITEA_HOME/app.ini" -GITEA_USER="git" -GITEA_VERSION="1.25.3" -GITEA_BINARY="/usr/local/bin/gitea" -GITEA_SERVICE="/etc/systemd/system/gitea.service" -DB_NAME="giteadb" -DB_USER="gitea" -GITEA_BACKUPS_DIR="/backups/gitea" - -# Gitea user -if ! id -u $GITEA_USER >/dev/null 2>&1; then - adduser \ - --system \ - --shell /bin/bash \ - --gecos 'Git Version Control' \ - --group \ - --disabled-password \ - --home /home/git \ - $GITEA_USER -fi -echo "---- Gitea user created ----" - -# Gitea folder structure -mkdir -p $GITEA_HOME/{custom,data,log} -chown -R $GITEA_USER:$GITEA_USER $GITEA_HOME -chmod -R 750 $GITEA_HOME - -if [ ! -f $GITEA_BINARY ]; then - wget -O /tmp/gitea "https://dl.gitea.com/gitea/$GITEA_VERSION/gitea-$GITEA_VERSION-linux-amd64" - chmod +x /tmp/gitea - mv /tmp/gitea $GITEA_BINARY -fi -echo "---- Gitea folder structure created ----" - -# Postgres first config -DB_PASS=$(openssl rand -base64 12) -sudo -u postgres psql < /usr/local/bin/restore-backup.sh </dev/null | sort | tail -n1) -# Restore backup database, data, repos, logs if exist -if [ -n "\$LATEST_BACKUP" ] && [ -f "\$LATEST_BACKUP" ]; then - TMP_DIR=$(mktemp -d) - unzip -o \$LATEST_BACKUP -d \$TMP_DIR - if [ -d \$TMP_DIR/data ]; then - cp -a \$TMP_DIR/data/* /var/lib/gitea/data/ - fi - if [ -d \$TMP_DIR/log ]; then - cp -a \$TMP_DIR/log/* /var/lib/gitea/log/ - fi - if [ -d \$TMP_DIR/repos ]; then - cp -aH \$TMP_DIR/repos/. /var/lib/gitea/data/repositories/ - fi - chown -R $GITEA_USER:$GITEA_USER $GITEA_HOME - sudo -u postgres psql -d $DB_NAME < \$TMP_DIR/gitea-db.sql - sudo -u postgres psql </dev/null 2>&1; then - echo "---- Backup found, restoring Gitea ----" - /usr/local/bin/restore-backup.sh -else - echo "---- No backup found in $GITEA_BACKUPS_DIR, skipping restore ----" -fi - -# Save restore backup service -cat > /etc/systemd/system/weekly-backup.service < /usr/local/bin/backup.sh < /etc/systemd/system/weekly-backup.service < /etc/systemd/system/weekly-backup.timer < "$GITEA_CONF" < "$GITEA_SERVICE" -${GITEA_SERVICE_CONTENT} -EOF - systemctl daemon-reload - systemctl enable gitea -fi - -# Enable timer for backup -sudo systemctl enable --now weekly-backup.timer -sudo systemctl status weekly-backup.timer - -systemctl is-active --quiet gitea || systemctl start gitea -echo "---- Gitea installation completed ----" \ No newline at end of file diff --git a/modules/apps/gitea/lib/scripts/install-gitea.sh b/modules/apps/gitea/lib/scripts/install-gitea.sh index 629961f..dfaacdc 100644 --- a/modules/apps/gitea/lib/scripts/install-gitea.sh +++ b/modules/apps/gitea/lib/scripts/install-gitea.sh @@ -77,6 +77,9 @@ ROOT = /var/lib/gitea/data/repositories [service] DISABLE_REGISTRATION = true + +[actions] +ENABLED=true EOF echo "---- Generated Gitea app.ini with secrets ----" diff --git a/modules/apps/gitea/main.tf b/modules/apps/gitea/main.tf index 8186fdf..0aeaea3 100644 --- a/modules/apps/gitea/main.tf +++ b/modules/apps/gitea/main.tf @@ -5,6 +5,7 @@ module "vm" { domain = var.domain vm_id = var.vm_id node_name = var.node_name + vm_ip_address = "192.168.1.90" template_id = var.template_id diff --git a/modules/vm/main.tf b/modules/vm/main.tf index bee61ca..9bf23b1 100644 --- a/modules/vm/main.tf +++ b/modules/vm/main.tf @@ -70,6 +70,13 @@ resource "proxmox_virtual_environment_vm" "vm" { } initialization { + ip_config { + ipv4 { + address = "${var.vm_ip_address}/24" + gateway = "192.168.1.1" + } + } + datastore_id = "local-lvm" interface = "ide2" user_data_file_id = proxmox_virtual_environment_file.cloud_user_config.id diff --git a/modules/vm/variables.tf b/modules/vm/variables.tf index 00e9b28..25da14c 100644 --- a/modules/vm/variables.tf +++ b/modules/vm/variables.tf @@ -53,4 +53,8 @@ variable "proxmox_host_ip" { variable "cloudinit_config" { type = string +} + +variable "vm_ip_address" { + type = string } \ No newline at end of file