Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options for mount of host system folder and apt mirror setup. #95

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions conf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Defines the Proxmox storage where your LXC container template are stored (defaul
```bash
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
Defines the size in GB of the LXC container's root filesystem (default: 32)
```bash
Expand All @@ -28,6 +33,11 @@ Defines the size in GB your LXC container's filesystem shared by Zamba (AD membe
```bash
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
Defines the Proxmox storage where your LXC container's filesystem shared by Zamba will be generated (default: local-zfs)
```bash
Expand Down
5 changes: 5 additions & 0 deletions conf/zamba.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# Defines the Proxmox storage where your LXC container template are stored (default: 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)
# Depending on your environment, you should consider increasing the size for use of `mailpiler` or `matrix`.
LXC_ROOTFS_SIZE="32"
Expand All @@ -26,6 +29,8 @@ LXC_SHAREFS_SIZE="100"
LXC_SHAREFS_STORAGE="local-zfs"
# Defines the mountpoint of the filesystem shared by Zamba inside your LXC container (default: 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=""

# cpu core count (default: 0 = unlimited)
LXC_THREADS=0
Expand Down
6 changes: 5 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ fi
sleep 2

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
sleep 2;

Expand Down
19 changes: 12 additions & 7 deletions src/lxc-base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,36 +26,41 @@ locale-gen $LXC_LOCALE
# Generate sources
if [ "$LXC_TEMPLATE_VERSION" == "debian-10-standard" ] ; then

if [ -n "$LXC_TEMPLATE_SET_MIRROR" ]; then
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
deb http://security.debian.org/debian-security buster/updates main contrib
EOF
fi

elif [ "$LXC_TEMPLATE_VERSION" == "debian-11-standard" ] ; then

if [ -n "$LXC_TEMPLATE_SET_MIRROR" ]; then
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
deb http://security.debian.org/debian-security bullseye-security main contrib
EOF

fi
elif [ "$LXC_TEMPLATE_VERSION" == "debian-12-standard" ] ; then

if [ -n "$LXC_TEMPLATE_SET_MIRROR" ]; then
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
deb http://security.debian.org/debian-security bookworm-security main contrib
EOF
fi

else echo "LXC Debian Version false. Please check configuration files!" ; exit
fi
Expand Down