mirror of
https://github.com/bashclub/zamba-lxc-toolbox.git
synced 2024-11-07 19:31:58 +01:00
coder weekend
This commit is contained in:
parent
f6cafff82e
commit
bda8bb9e86
15
install.sh
Normal file → Executable file
15
install.sh
Normal file → Executable file
@ -93,15 +93,15 @@ fi
|
||||
source $PWD/src/$service/constants-service.conf
|
||||
|
||||
# CHeck is the newest template available, else download it.
|
||||
DEB_LOC=$(pveam list $LXC_TEMPLATE_STORAGE | grep debian-10-standard | cut -d'_' -f2)
|
||||
DEB_REP=$(pveam available --section system | grep debian-10-standard | cut -d'_' -f2)
|
||||
DEB_LOC=$(pveam list $LXC_TEMPLATE_STORAGE | grep $LXC_TEMPLATE_VERSION | cut -d'_' -f2)
|
||||
DEB_REP=$(pveam available --section system | grep $LXC_TEMPLATE_VERSION | cut -d'_' -f2)
|
||||
|
||||
if [[ $DEB_LOC == $DEB_REP ]];
|
||||
then
|
||||
echo "Newest Version of Debian 10 Standard $DEP_REP exists.";
|
||||
echo "Newest Version of $LXC_TEMPLATE_VERSION $DEP_REP exists.";
|
||||
else
|
||||
echo "Will now download newest Debian 10 Standard $DEP_REP.";
|
||||
pveam download $LXC_TEMPLATE_STORAGE debian-10-standard_$DEB_REP\_amd64.tar.gz
|
||||
echo "Will now download newest $LXC_TEMPLATE_VERSION $DEP_REP.";
|
||||
pveam download $LXC_TEMPLATE_STORAGE "$LXC_TEMPLATE_VERSION"_$DEB_REP\_amd64.tar.gz
|
||||
fi
|
||||
|
||||
if [ $ctid -gt 99 ]; then
|
||||
@ -120,7 +120,7 @@ fi
|
||||
echo "Will now create LXC Container $LXC_NBR!";
|
||||
|
||||
# Create the container
|
||||
pct create $LXC_NBR -unprivileged $LXC_UNPRIVILEGED $LXC_TEMPLATE_STORAGE:vztmpl/debian-10-standard_$DEB_REP\_amd64.tar.gz -rootfs $LXC_ROOTFS_STORAGE:$LXC_ROOTFS_SIZE;
|
||||
pct create $LXC_NBR -unprivileged $LXC_UNPRIVILEGED $LXC_TEMPLATE_STORAGE:vztmpl/"$LXC_TEMPLATE_VERSION"_$DEB_REP\_amd64.tar.gz -rootfs $LXC_ROOTFS_STORAGE:$LXC_ROOTFS_SIZE;
|
||||
sleep 2;
|
||||
|
||||
# Check vlan configuration
|
||||
@ -147,7 +147,6 @@ sleep 5;
|
||||
echo -e "$LXC_PWD\n$LXC_PWD" | lxc-attach -n$LXC_NBR passwd;
|
||||
lxc-attach -n$LXC_NBR mkdir /root/.ssh;
|
||||
pct push $LXC_NBR $LXC_AUTHORIZED_KEY /root/.ssh/authorized_keys
|
||||
pct push $LXC_NBR $PWD/src/sources.list /etc/apt/sources.list
|
||||
pct push $LXC_NBR $config /root/zamba.conf
|
||||
pct push $LXC_NBR $PWD/src/constants.conf /root/constants.conf
|
||||
pct push $LXC_NBR $PWD/src/lxc-base.sh /root/lxc-base.sh
|
||||
@ -163,4 +162,4 @@ if [[ $service == "zmb-ad" ]]; then
|
||||
pct stop $LXC_NBR
|
||||
pct set $LXC_NBR \-nameserver $(echo $LXC_IP | cut -d'/' -f 1)
|
||||
pct start $LXC_NBR
|
||||
fi
|
||||
fi
|
@ -7,6 +7,9 @@
|
||||
|
||||
# This file contains the project constants on service level
|
||||
|
||||
# Debian Version, which will be installed
|
||||
LXC_TEMPLATE_VERSION="debian-11-standard"
|
||||
|
||||
# Create sharefs mountpoint
|
||||
LXC_MP="0"
|
||||
|
||||
|
@ -7,6 +7,9 @@
|
||||
|
||||
# This file contains the project constants on service level
|
||||
|
||||
# Debian Version, which will be installed
|
||||
LXC_TEMPLATE_VERSION="debian-11-standard"
|
||||
|
||||
# Create sharefs mountpoint
|
||||
LXC_MP="0"
|
||||
|
||||
|
@ -7,6 +7,9 @@
|
||||
|
||||
# This file contains the project constants on service level
|
||||
|
||||
# Debian Version, which will be installed
|
||||
LXC_TEMPLATE_VERSION="debian-10-standard"
|
||||
|
||||
# Create sharefs mountpoint
|
||||
LXC_MP="0"
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
echo "Loading configuration..."
|
||||
source /root/zamba.conf
|
||||
source /root/constants.conf
|
||||
source /root/constants-service.conf
|
||||
|
||||
echo "Updating locales"
|
||||
# update locales
|
||||
@ -17,11 +18,36 @@ cat << EOF > /etc/default/locale
|
||||
LANG="$LXC_LOCALE"
|
||||
LANGUAGE=$LXC_LOCALE
|
||||
EOF
|
||||
locale-gen $LXC_LOCALE
|
||||
locale-gen $LXC_LOCALE
|
||||
|
||||
# Generate sources
|
||||
if [ "$LXC_TEMPLATE_VERSION" == "debian-11-standard" ] ; then
|
||||
|
||||
cat << EOF > /etc/apt/sources.list
|
||||
deb http://ftp.de.debian.org/debian bullseye main contrib
|
||||
|
||||
deb http://ftp.de.debian.org/debian bullseye-updates main contrib
|
||||
|
||||
# security updates
|
||||
deb http://security.debian.org bullseye-security main contrib
|
||||
EOF
|
||||
|
||||
elif [ "$LXC_TEMPLATE_VERSION" == "debian-10-standard" ] ; then
|
||||
|
||||
cat << EOF > /etc/apt/sources.list
|
||||
deb http://ftp.de.debian.org/debian buster main contrib
|
||||
|
||||
deb http://ftp.de.debian.org/debian buster-updates main contrib
|
||||
|
||||
# security updates
|
||||
deb http://security.debian.org buster/updates main contrib
|
||||
EOF
|
||||
else echo "LXC Debian Version false. Please check configuration files!" ; exit
|
||||
fi
|
||||
|
||||
# update package lists
|
||||
echo "Updating package database..."
|
||||
apt update
|
||||
apt --allow-releaseinfo-change update
|
||||
|
||||
# install latest packages
|
||||
echo "Installing latest updates"
|
||||
|
@ -7,6 +7,8 @@
|
||||
|
||||
# This file contains the project constants on service level
|
||||
|
||||
# Debian Version, which will be installed
|
||||
LXC_TEMPLATE_VERSION="debian-10-standard"
|
||||
|
||||
# Create sharefs mountpoint
|
||||
LXC_MP="0"
|
||||
|
@ -7,6 +7,9 @@
|
||||
|
||||
# This file contains the project constants on service level
|
||||
|
||||
# Debian Version, which will be installed
|
||||
LXC_TEMPLATE_VERSION="debian-10-standard"
|
||||
|
||||
# Create sharefs mountpoint
|
||||
LXC_MP="0"
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
|
||||
# This file contains the project constants on service level
|
||||
|
||||
# Debian Version, which will be installed
|
||||
LXC_TEMPLATE_VERSION="debian-10-standard"
|
||||
|
||||
# Create sharefs mountpoint
|
||||
LXC_MP="1"
|
||||
|
@ -7,6 +7,9 @@
|
||||
|
||||
# This file contains the project constants on service level
|
||||
|
||||
# Debian Version, which will be installed
|
||||
LXC_TEMPLATE_VERSION="debian-11-standard"
|
||||
|
||||
# Create sharefs mountpoint
|
||||
LXC_MP="0"
|
||||
|
||||
|
@ -7,6 +7,9 @@
|
||||
|
||||
# This file contains the project constants on service level
|
||||
|
||||
# Debian Version, which will be installed
|
||||
LXC_TEMPLATE_VERSION="debian-10-standard"
|
||||
|
||||
# Create sharefs mountpoint
|
||||
LXC_MP="0"
|
||||
|
||||
|
23
src/proxmox-pbs/constants-service.conf
Normal file
23
src/proxmox-pbs/constants-service.conf
Normal file
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Authors:
|
||||
# (C) 2021 Idea an concept by Christian Zengel <christian@sysops.de>
|
||||
# (C) 2021 Script design and prototype by Markus Helmke <m.helmke@nettwarker.de>
|
||||
# (C) 2021 Script rework and documentation by Thorsten Spille <thorsten@spille-edv.de>
|
||||
|
||||
# This file contains the project constants on service level
|
||||
|
||||
# Debian Version, which will be installed
|
||||
LXC_TEMPLATE_VERSION="debian-11-standard"
|
||||
|
||||
# Create sharefs mountpoint
|
||||
LXC_MP="1"
|
||||
|
||||
# Create unprivileged container
|
||||
LXC_UNPRIVILEGED="1"
|
||||
|
||||
# enable nesting feature
|
||||
LXC_NESTING="0"
|
||||
|
||||
# Backup ubdir where Urbackup will store backups
|
||||
PBS_DATA="backup"
|
22
src/proxmox-pbs/install-service.sh
Normal file
22
src/proxmox-pbs/install-service.sh
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Authors:
|
||||
# (C) 2021 Idea an concept by Christian Zengel <christian@sysops.de>
|
||||
# (C) 2021 Script design and prototype by Markus Helmke <m.helmke@nettwarker.de>
|
||||
# (C) 2021 Script rework and documentation by Thorsten Spille <thorsten@spille-edv.de>
|
||||
|
||||
source /root/zamba.conf
|
||||
source /root/constants-service.conf
|
||||
|
||||
cat << EOF > /etc/apt/sources.list.d/pbs-no-subscription.list
|
||||
# PBS pbs-no-subscription repository provided by proxmox.com,
|
||||
# NOT recommended for production use
|
||||
deb http://download.proxmox.com/debian/pbs bullseye pbs-no-subscription
|
||||
EOF
|
||||
|
||||
wget https://enterprise.proxmox.com/debian/proxmox-release-bullseye.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bullseye.gpg
|
||||
|
||||
apt update && apt upgrade -y
|
||||
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt install -y -o DPkg::options::="--force-confdef" -o DPkg::options::="--force-confold" proxmox-backup-server
|
||||
|
||||
proxmox-backup-manager datastore create $PBS_DATA /$LXC_SHAREFS_MOUNTPOINT/$PBS_DATA
|
23
src/urbackup/constants-service.conf
Normal file
23
src/urbackup/constants-service.conf
Normal file
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Authors:
|
||||
# (C) 2021 Idea an concept by Christian Zengel <christian@sysops.de>
|
||||
# (C) 2021 Script design and prototype by Markus Helmke <m.helmke@nettwarker.de>
|
||||
# (C) 2021 Script rework and documentation by Thorsten Spille <thorsten@spille-edv.de>
|
||||
|
||||
# This file contains the project constants on service level
|
||||
|
||||
# Debian Version, which will be installed
|
||||
LXC_TEMPLATE_VERSION="debian-10-standard"
|
||||
|
||||
# Create sharefs mountpoint
|
||||
LXC_MP="1"
|
||||
|
||||
# Create unprivileged container
|
||||
LXC_UNPRIVILEGED="1"
|
||||
|
||||
# enable nesting feature
|
||||
LXC_NESTING="0"
|
||||
|
||||
# Backup ubdir where Urbackup will store backups
|
||||
URBACKUP_DATA="urbackup"
|
20
src/urbackup/install-service.sh
Normal file
20
src/urbackup/install-service.sh
Normal file
@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Authors:
|
||||
# (C) 2021 Idea an concept by Christian Zengel <christian@sysops.de>
|
||||
# (C) 2021 Script design and prototype by Markus Helmke <m.helmke@nettwarker.de>
|
||||
# (C) 2021 Script rework and documentation by Thorsten Spille <thorsten@spille-edv.de>
|
||||
|
||||
source /root/zamba.conf
|
||||
source /root/constants-service.conf
|
||||
|
||||
mkdir /$LXC_SHAREFS_MOUNTPOINT/$URBACKUP_DATA
|
||||
mkdir /etc/urbackup
|
||||
echo "/$LXC_SHAREFS_MOUNTPOINT/$URBACKUP_DATA" > /etc/urbackup/backupfolder
|
||||
|
||||
echo 'deb http://download.opensuse.org/repositories/home:/uroni/Debian_10/ /' | tee /etc/apt/sources.list.d/home:uroni.list
|
||||
curl -fsSL https://download.opensuse.org/repositories/home:uroni/Debian_10/Release.key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/home_uroni.gpg > /dev/null
|
||||
|
||||
apt update
|
||||
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt install -y --no-install-recommends -o DPkg::options::="--force-confdef" -o DPkg::options::="--force-confold" urbackup-server
|
||||
chown urbackup:urbackup /$LXC_SHAREFS_MOUNTPOINT/$URBACKUP_DATA
|
@ -7,6 +7,9 @@
|
||||
|
||||
# This file contains the project constants on service level
|
||||
|
||||
# Debian Version, which will be installed
|
||||
LXC_TEMPLATE_VERSION="debian-11-standard"
|
||||
|
||||
# Defines the desired DNS server backend, supported are `SAMBA_INTERNAL` and `BIND9_DLZ` for more advanced usage
|
||||
ZMB_DNS_BACKEND="SAMBA_INTERNAL"
|
||||
|
||||
|
@ -7,6 +7,9 @@
|
||||
|
||||
# This file contains the project constants on service level
|
||||
|
||||
# Debian Version, which will be installed
|
||||
LXC_TEMPLATE_VERSION="debian-11-standard"
|
||||
|
||||
# Create sharefs mountpoint
|
||||
LXC_MP="1"
|
||||
|
||||
|
@ -7,6 +7,9 @@
|
||||
|
||||
# This file contains the project constants on service level
|
||||
|
||||
# Debian Version, which will be installed
|
||||
LXC_TEMPLATE_VERSION="debian-11-standard"
|
||||
|
||||
# Create sharefs mountpoint
|
||||
LXC_MP="1"
|
||||
|
||||
|
14
testinstall
Executable file
14
testinstall
Executable file
@ -0,0 +1,14 @@
|
||||
|
||||
bash -vx install.sh -s checkmk > checkmk.inst.log
|
||||
bash -vx install.sh -s debian-unpriv > debian-unpriv.inst.log
|
||||
bash -vx install.sh -s matrix > matrix.inst.log
|
||||
bash -vx install.sh -s nextcloud > nextcloud.inst.log
|
||||
bash -vx install.sh -s open3a > open3a.inst.log
|
||||
bash -vx install.sh -s zmb-ad > zmb-ad.inst.log
|
||||
bash -vx install.sh -s zmb-member > zmb-member.inst.log
|
||||
bash -vx install.sh -s zmb-standalone > zmb-standalone.inst.log
|
||||
bash -vx install.sh -s debian-priv > debian-priv.inst.log
|
||||
bash -vx install.sh -s mailpiler > mailpiler.inst.log
|
||||
bash -vx install.sh -s onlyoffice > onlyoffice.inst.log
|
||||
bash -vx install.sh -s proxmox-pbs > proxmox-pbs.inst.log
|
||||
bash -vx install.sh -s urbackup > urbackup.inst.log
|
Loading…
Reference in New Issue
Block a user