85 lines
1.9 KiB
YAML
85 lines
1.9 KiB
YAML
#cloud-config
|
|
hostname: ${hostname}
|
|
local-hostname: ${hostname}
|
|
fqdn: ${hostname}.${domain}
|
|
manage_etc_hosts: true
|
|
|
|
groups:
|
|
- git
|
|
|
|
users:
|
|
- default
|
|
- name: ${hostname}
|
|
groups: sudo,git
|
|
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
|
|
- unzip
|
|
- postgresql
|
|
- postgresql-client
|
|
|
|
write_files:
|
|
- path: /etc/fstab
|
|
permissions: "0644"
|
|
content: |
|
|
${proxmox_host_ip}:/main/backups /backups nfs defaults,_netdev 0 0
|
|
- path: /opt/gitea/env.sh
|
|
permissions: "0644"
|
|
content: |
|
|
${environment-setup-script}
|
|
- 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/gitea.service
|
|
permissions: "0644"
|
|
content: |
|
|
${gitea-service}
|
|
- path: /opt/gitea/install-gitea.sh
|
|
permissions: "0755"
|
|
content: |
|
|
${install-gitea-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}
|
|
# gitea setup
|
|
- /opt/gitea/install-gitea.sh
|
|
|
|
final_message: |
|
|
Base system ready for ${hostname} |