add bookshelf module, fix gitea minor typo, add fixe ip for vms

This commit is contained in:
2026-01-14 10:15:55 +01:00
parent b735996b8d
commit d98c7b8bdb
20 changed files with 410 additions and 230 deletions

View File

@@ -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}