Add options for bind-mount of host filesystem folder and apt mirror setup.

This commit is contained in:
greg.gaskill 2023-08-10 10:31:55 -04:00
parent 95d1ebd013
commit a5e7658490
4 changed files with 32 additions and 8 deletions

View File

@ -12,6 +12,11 @@ Defines the Proxmox storage where your LXC container template are stored (defaul
```bash ```bash
LXC_TEMPLATE_STORAGE="local" LXC_TEMPLATE_STORAGE="local"
``` ```
### LXC_TEMPLATE_SET_MIRROR
Delault mirror setting for /etc/apt/sources.list (default: "", leaves the file unchanged)
```bash
LXC_TEMPLATE_SET_MIRROR=""
```
### LXC_ROOTFS_SIZE ### LXC_ROOTFS_SIZE
Defines the size in GB of the LXC container's root filesystem (default: 32) Defines the size in GB of the LXC container's root filesystem (default: 32)
```bash ```bash
@ -28,6 +33,11 @@ Defines the size in GB your LXC container's filesystem shared by Zamba (AD membe
```bash ```bash
LXC_SHAREFS_SIZE="100" LXC_SHAREFS_SIZE="100"
``` ```
### LXC_SHAREFS_BINDMOUNT
Defines a the host system folder to be bind-mounted and shared by Zamba. Requires LXC_SHAREFS_SIZE > 0 but ignores the value. (AD member & standalone) (default: "")
```bash
LXC_SHAREFS_BINDMOUNT="/host/folder"
```
### LXC_SHAREFS_STORAGE ### LXC_SHAREFS_STORAGE
Defines the Proxmox storage where your LXC container's filesystem shared by Zamba will be generated (default: local-zfs) Defines the Proxmox storage where your LXC container's filesystem shared by Zamba will be generated (default: local-zfs)
```bash ```bash

View File

@ -14,6 +14,9 @@
# Defines the Proxmox storage where your LXC container template are stored (default: local) # Defines the Proxmox storage where your LXC container template are stored (default: local)
LXC_TEMPLATE_STORAGE="local" LXC_TEMPLATE_STORAGE="local"
# Delault mirror setting for /etc/apt/sources.list (default: "", leaves the file unchanged)
LXC_TEMPLATE_SET_MIRROR=""
# Defines the size in GB of the LXC container's root filesystem (default: 32) # Defines the size in GB of the LXC container's root filesystem (default: 32)
# Depending on your environment, you should consider increasing the size for use of `mailpiler` or `matrix`. # Depending on your environment, you should consider increasing the size for use of `mailpiler` or `matrix`.
LXC_ROOTFS_SIZE="32" LXC_ROOTFS_SIZE="32"
@ -26,6 +29,8 @@ LXC_SHAREFS_SIZE="100"
LXC_SHAREFS_STORAGE="local-zfs" LXC_SHAREFS_STORAGE="local-zfs"
# Defines the mountpoint of the filesystem shared by Zamba inside your LXC container (default: tank) # Defines the mountpoint of the filesystem shared by Zamba inside your LXC container (default: tank)
LXC_SHAREFS_MOUNTPOINT="tank" LXC_SHAREFS_MOUNTPOINT="tank"
# Defines a the host system folder to be bind-mounted and shared by Zamba. Requires LXC_SHAREFS_SIZE > 0 but ignores the value. (AD member & standalone) (default: "")
LXC_SHAREFS_BINDMOUNT=""
# Defines the amount of RAM in MB your LXC container is allowed to use (default: 1024) # Defines the amount of RAM in MB your LXC container is allowed to use (default: 1024)
LXC_MEM=1024 LXC_MEM=1024

View File

@ -148,7 +148,11 @@ fi
sleep 2 sleep 2
if [ $LXC_MP -gt 0 ]; then if [ $LXC_MP -gt 0 ]; then
pct set $LXC_NBR -mp0 $LXC_SHAREFS_STORAGE:$LXC_SHAREFS_SIZE,backup=1,mp=/$LXC_SHAREFS_MOUNTPOINT if [ -z "$LXC_SHAREFS_BINDMOUNT" ]; then
pct set $LXC_NBR -mp0 $LXC_SHAREFS_STORAGE:$LXC_SHAREFS_SIZE,backup=1,mp=/$LXC_SHAREFS_MOUNTPOINT
else
pct set $LXC_NBR -mp0 volume=$LXC_SHAREFS_BINDMOUNT,mp=$LXC_SHAREFS_MOUNTPOINT
fi
fi fi
sleep 2; sleep 2;

View File

@ -26,36 +26,41 @@ locale-gen $LXC_LOCALE
# Generate sources # Generate sources
if [ "$LXC_TEMPLATE_VERSION" == "debian-10-standard" ] ; then if [ "$LXC_TEMPLATE_VERSION" == "debian-10-standard" ] ; then
if [ -n "$LXC_TEMPLATE_SET_MIRROR" ]; then
cat << EOF > /etc/apt/sources.list cat << EOF > /etc/apt/sources.list
deb http://ftp.halifax.rwth-aachen.de/debian/ buster main contrib deb $LXC_TEMPLATE_SET_MIRROR/debian/ buster main contrib
deb http://ftp.halifax.rwth-aachen.de/debian/ buster-updates main contrib deb $LXC_TEMPLATE_SET_MIRROR/debian/ buster-updates main contrib
# security updates # security updates
deb http://security.debian.org/debian-security buster/updates main contrib deb http://security.debian.org/debian-security buster/updates main contrib
EOF EOF
fi
elif [ "$LXC_TEMPLATE_VERSION" == "debian-11-standard" ] ; then elif [ "$LXC_TEMPLATE_VERSION" == "debian-11-standard" ] ; then
if [ -n "$LXC_TEMPLATE_SET_MIRROR" ]; then
cat << EOF > /etc/apt/sources.list cat << EOF > /etc/apt/sources.list
deb http://ftp.halifax.rwth-aachen.de/debian/ bullseye main contrib deb $LXC_TEMPLATE_SET_MIRROR/debian/ bullseye main contrib
deb http://ftp.halifax.rwth-aachen.de/debian/ bullseye-updates main contrib deb $LXC_TEMPLATE_SET_MIRROR/debian/ bullseye-updates main contrib
# security updates # security updates
deb http://security.debian.org/debian-security bullseye-security main contrib deb http://security.debian.org/debian-security bullseye-security main contrib
EOF EOF
fi
elif [ "$LXC_TEMPLATE_VERSION" == "debian-12-standard" ] ; then elif [ "$LXC_TEMPLATE_VERSION" == "debian-12-standard" ] ; then
if [ -n "$LXC_TEMPLATE_SET_MIRROR" ]; then
cat << EOF > /etc/apt/sources.list cat << EOF > /etc/apt/sources.list
deb http://ftp.halifax.rwth-aachen.de/debian/ bookworm main contrib deb $LXC_TEMPLATE_SET_MIRROR/debian/ bookworm main contrib
deb http://ftp.halifax.rwth-aachen.de/debian/ bookworm-updates main contrib deb $LXC_TEMPLATE_SET_MIRROR/debian/ bookworm-updates main contrib
# security updates # security updates
deb http://security.debian.org/debian-security bookworm-security main contrib deb http://security.debian.org/debian-security bookworm-security main contrib
EOF EOF
fi
else echo "LXC Debian Version false. Please check configuration files!" ; exit else echo "LXC Debian Version false. Please check configuration files!" ; exit
fi fi