From 661bb4e074fed0e1e242bb25af00d763cc3f2c80 Mon Sep 17 00:00:00 2001 From: JulienAldon Date: Tue, 20 Jan 2026 01:09:06 +0100 Subject: [PATCH] fix typo --- README.md | 68 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 48 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index bfdf515..63f2f46 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ # Terraform - ## Basic Proxmox setup Add `TerraformProv` role ```sh @@ -26,15 +25,17 @@ Add environment variable ```sh cp terraform.tfvars.example ``` -fill with your secrets (do no push this file) +> ![NOTE] +> fill with your secrets (do no push this file) ## Usefull commands +### OpenTofu ```sh -opentofu.tofu init -opentofu.tofu plan -opentofu.tofu apply -opentofu.tofu destroy -tofu apply -target module. +tofu init # initialize module +tofu plan # test configuration +tofu apply # apply configuration +tofu destroy # destroy all vm +tofu apply -target module. # apply a specific module ``` ### On WSL @@ -230,18 +231,6 @@ package_update: true package_upgrade: false ``` -##### Backup setup -```hcl -packages: - - nfs-common - -mounts: - - [ "192.168.1.12:/main/backups", "/backups", "nfs", "defaults,_netdev,x-systemd.requires=network-online.target", "0", "0" ] -``` - -`nfs-common`: NFS mount package for `/main/backups` mount point. -`mounts`: adds NFS mount point to `/etc/fstab` file. - ##### Environment variables for scripts ```hcl write_files: @@ -253,4 +242,43 @@ write_files: permissions: "0644" content: | ${env-file-content} -``` \ No newline at end of file +``` + +`.env.example` files are given in each modules describing mandatory variables used by scripts. + +##### Backup setup +```hcl +packages: + - nfs-common + +mounts: + - [ "192.168.1.12:/main/backups", "/backups", "nfs", "defaults,_netdev,x-systemd.requires=network-online.target", "0", "0" ] + +write_files: + - 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/create-backup.timer + permissions: "0644" + content: | + ${create-backup-timer} + - path: /etc/systemd/system/create-backup.service + permissions: "0644" + content: | + ${create-backup-service} +``` +- `restore-backup.sh`: Restore backup script (specific per module). +- `restore-backup.service`: Restore backup `systemd` service (common for all modules). +- `create-backup.service`: Create backup `systemd` service (common for all modules). +- `create-backup.timer`: Create backup `systemd` timer (common for all modules). +- `nfs-common`: NFS mount package for `/main/backups` mount point. +- `mounts`: adds NFS mount point to `/etc/fstab` file. \ No newline at end of file