diff --git a/conf/zamba.conf.example b/conf/zamba.conf.example index 127f9a4..9ddc3df 100644 --- a/conf/zamba.conf.example +++ b/conf/zamba.conf.example @@ -84,6 +84,12 @@ LXC_VIM_BG_DARK=1 # Default random password length LXC_RANDOMPWD=32 +# Automatically add meta tags to lxc container +LXC_AUTOTAG=1 + +# Add meta tags to linux container +LXC_TAGS="linux,debian,${service}" + ############### Zamba-Server-Section ############### # Defines the REALM for the Active Directory (AD DC, AD member) diff --git a/install.sh b/install.sh index 02a05b3..8e5b4c9 100755 --- a/install.sh +++ b/install.sh @@ -102,6 +102,10 @@ source "$config" source "$PWD/src/$service/constants-service.conf" +if [ $LXC_AUTOTAG -gt 0 ]; then + TAGS="--tags ${LXC_TAGS},${SERVICE_TAGS}" +fi + # CHeck is the newest template available, else download it. DEB_LOC=$(pveam list $LXC_TEMPLATE_STORAGE | grep $LXC_TEMPLATE_VERSION | tail -1 | cut -d'_' -f2) DEB_REP=$(pveam available --section system | grep $LXC_TEMPLATE_VERSION | tail -1 | cut -d'_' -f2) @@ -131,7 +135,7 @@ fi echo "Will now create LXC Container $LXC_NBR!"; # Create the container -pct create $LXC_NBR --password $LXC_PWD -unprivileged $LXC_UNPRIVILEGED $LXC_TEMPLATE_STORAGE:vztmpl/$TMPL_NAME -rootfs $LXC_ROOTFS_STORAGE:$LXC_ROOTFS_SIZE; +pct create $LXC_NBR $TAGS --password $LXC_PWD -unprivileged $LXC_UNPRIVILEGED $LXC_TEMPLATE_STORAGE:vztmpl/$TMPL_NAME -rootfs $LXC_ROOTFS_STORAGE:$LXC_ROOTFS_SIZE; sleep 2; # Check vlan configuration diff --git a/src/bookstack/constants-service.conf b/src/bookstack/constants-service.conf index 4f5ef36..1f9a027 100644 --- a/src/bookstack/constants-service.conf +++ b/src/bookstack/constants-service.conf @@ -17,4 +17,7 @@ LXC_MP="0" LXC_UNPRIVILEGED="1" # enable nesting feature -LXC_NESTING="1" \ No newline at end of file +LXC_NESTING="1" + +# service dependent meta tags +SERVICE_TAGS="php-fpm,nginx,mariadb" \ No newline at end of file diff --git a/src/checkmk/constants-service.conf b/src/checkmk/constants-service.conf index 3ebbaa3..c0042df 100644 --- a/src/checkmk/constants-service.conf +++ b/src/checkmk/constants-service.conf @@ -23,3 +23,6 @@ LXC_NESTING="1" CMK_VERSION=2.1.0p19 # build number of the debian package (needs to start with underscore) CMK_BUILD=_0 + +# service dependent meta tags +SERVICE_TAGS="apache2" \ No newline at end of file diff --git a/src/debian-priv/constants-service.conf b/src/debian-priv/constants-service.conf index 1f764d7..550f81c 100644 --- a/src/debian-priv/constants-service.conf +++ b/src/debian-priv/constants-service.conf @@ -17,4 +17,7 @@ LXC_MP="0" LXC_UNPRIVILEGED="0" # enable nesting feature -LXC_NESTING="1" \ No newline at end of file +LXC_NESTING="1" + +# service dependent meta tags +SERVICE_TAGS="privileged" \ No newline at end of file diff --git a/src/debian-unpriv/constants-service.conf b/src/debian-unpriv/constants-service.conf index 4f5ef36..a05e518 100644 --- a/src/debian-unpriv/constants-service.conf +++ b/src/debian-unpriv/constants-service.conf @@ -17,4 +17,7 @@ LXC_MP="0" LXC_UNPRIVILEGED="1" # enable nesting feature -LXC_NESTING="1" \ No newline at end of file +LXC_NESTING="1" + +# service dependent meta tags +SERVICE_TAGS="" \ No newline at end of file diff --git a/src/gitea/constants-service.conf b/src/gitea/constants-service.conf index af82f81..eb2ff1e 100644 --- a/src/gitea/constants-service.conf +++ b/src/gitea/constants-service.conf @@ -32,4 +32,7 @@ GITEA_DB_NAME="gitea" GITEA_DB_USR="gitea" # Build a strong password for the SQL user - could be overwritten with something fixed -GITEA_DB_PWD="$(random_password)" \ No newline at end of file +GITEA_DB_PWD="$(random_password)" + +# service dependent meta tags +SERVICE_TAGS="nginx,postgresql" \ No newline at end of file diff --git a/src/kimai/constants-service.conf b/src/kimai/constants-service.conf index b0bef6e..2753b7a 100644 --- a/src/kimai/constants-service.conf +++ b/src/kimai/constants-service.conf @@ -24,3 +24,6 @@ KIMAI_VERSION="main" # Defines the php version to install KIMAI_PHP_VERSION="8.1" + +# service dependent meta tags +SERVICE_TAGS="php-fpm,nginx,mariadb" \ No newline at end of file diff --git a/src/kopano-core/constants-service.conf b/src/kopano-core/constants-service.conf index 739d6d1..c393914 100644 --- a/src/kopano-core/constants-service.conf +++ b/src/kopano-core/constants-service.conf @@ -39,3 +39,5 @@ MARIA_DB_USER="kopano" MARIA_ROOT_PWD=$(random_password) MARIA_USER_PWD=$(random_password) +# service dependent meta tags +SERVICE_TAGS="php-fpm,nginx,mariadb" \ No newline at end of file diff --git a/src/mailpiler/constants-service.conf b/src/mailpiler/constants-service.conf index c943bf2..3a295e7 100644 --- a/src/mailpiler/constants-service.conf +++ b/src/mailpiler/constants-service.conf @@ -25,3 +25,6 @@ PILER_VERSION="1.3.12" PILER_SPHINX_VERSION="3.3.1" # Defines the php version to install PILER_PHP_VERSION="7.4" + +# service dependent meta tags +SERVICE_TAGS="php-fpm,nginx,mariadb,sphinx" \ No newline at end of file diff --git a/src/matrix/constants-service.conf b/src/matrix/constants-service.conf index 292d2ce..d544d5c 100644 --- a/src/matrix/constants-service.conf +++ b/src/matrix/constants-service.conf @@ -21,3 +21,6 @@ LXC_NESTING="1" # Define the version of Element Web MATRIX_ELEMENT_VERSION="v1.9.9" + +# service dependent meta tags +SERVICE_TAGS="nginx,postgresql" \ No newline at end of file diff --git a/src/nextcloud/constants-service.conf b/src/nextcloud/constants-service.conf index c805262..81dca34 100644 --- a/src/nextcloud/constants-service.conf +++ b/src/nextcloud/constants-service.conf @@ -39,3 +39,6 @@ NEXTCLOUD_DB_USR="nextcloud" # Build a strong password for the SQL user - could be overwritten with something fixed NEXTCLOUD_DB_PWD="$(random_password)" + +# service dependent meta tags +SERVICE_TAGS="php-fpm,nginx,postgresql" \ No newline at end of file diff --git a/src/onlyoffice/constants-service.conf b/src/onlyoffice/constants-service.conf index bbaeda4..416c1b2 100644 --- a/src/onlyoffice/constants-service.conf +++ b/src/onlyoffice/constants-service.conf @@ -23,4 +23,7 @@ ONLYOFFICE_DB_HOST=localhost ONLYOFFICE_DB_NAME=onlyoffice -ONLYOFFICE_DB_USER=onlyoffice \ No newline at end of file +ONLYOFFICE_DB_USER=onlyoffice + +# service dependent meta tags +SERVICE_TAGS="nginx,postgresql,rabbitmq" \ No newline at end of file diff --git a/src/open3a/constants-service.conf b/src/open3a/constants-service.conf index 4f5ef36..1f9a027 100644 --- a/src/open3a/constants-service.conf +++ b/src/open3a/constants-service.conf @@ -17,4 +17,7 @@ LXC_MP="0" LXC_UNPRIVILEGED="1" # enable nesting feature -LXC_NESTING="1" \ No newline at end of file +LXC_NESTING="1" + +# service dependent meta tags +SERVICE_TAGS="php-fpm,nginx,mariadb" \ No newline at end of file diff --git a/src/proxmox-pbs/constants-service.conf b/src/proxmox-pbs/constants-service.conf index b0609cd..4151e54 100644 --- a/src/proxmox-pbs/constants-service.conf +++ b/src/proxmox-pbs/constants-service.conf @@ -20,4 +20,7 @@ LXC_UNPRIVILEGED="1" LXC_NESTING="1" # Backup ubdir where Urbackup will store backups -PBS_DATA="backup" \ No newline at end of file +PBS_DATA="backup" + +# service dependent meta tags +SERVICE_TAGS="backup" \ No newline at end of file diff --git a/src/unifi/constants-service.conf b/src/unifi/constants-service.conf index 4f5ef36..e38defb 100644 --- a/src/unifi/constants-service.conf +++ b/src/unifi/constants-service.conf @@ -17,4 +17,7 @@ LXC_MP="0" LXC_UNPRIVILEGED="1" # enable nesting feature -LXC_NESTING="1" \ No newline at end of file +LXC_NESTING="1" + +# service dependent meta tags +SERVICE_TAGS="mongodb-server,java" \ No newline at end of file diff --git a/src/urbackup/constants-service.conf b/src/urbackup/constants-service.conf index c63658b..bb9e804 100644 --- a/src/urbackup/constants-service.conf +++ b/src/urbackup/constants-service.conf @@ -23,4 +23,7 @@ LXC_NESTING="1" URBACKUP_DATA="urbackup" # OS codename for opensuse / urbackup repo -REPO_CODENAME="Debian_11" \ No newline at end of file +REPO_CODENAME="Debian_11" + +# service dependent meta tags +SERVICE_TAGS="nginx" \ No newline at end of file diff --git a/src/vaultwarden/constants-service.conf b/src/vaultwarden/constants-service.conf index fe2b115..ee433eb 100644 --- a/src/vaultwarden/constants-service.conf +++ b/src/vaultwarden/constants-service.conf @@ -26,4 +26,7 @@ VAULTWARDEN_DB_NAME="vaultwarden" VAULTWARDEN_DB_USR="vaultwarden" # Build a strong password for the SQL user - could be overwritten with something fixed -VAULTWARDEN_DB_PWD="$(random_password)" \ No newline at end of file +VAULTWARDEN_DB_PWD="$(random_password)" + +# service dependent meta tags +SERVICE_TAGS="nginx,postgresql" \ No newline at end of file diff --git a/src/vaultwarden/install-service.sh b/src/vaultwarden/install-service.sh index 0ffa636..bee4f3c 100644 --- a/src/vaultwarden/install-service.sh +++ b/src/vaultwarden/install-service.sh @@ -41,7 +41,6 @@ ORG_CREATION_USERS=admin@$LXC_DOMAIN ADMIN_TOKEN=$admin_token # Uncomment this once vaults restored SIGNUPS_ALLOWED=false -INVITATIONS_ALLOWED=false SMTP_HOST=$VW_SMTP_HOST SMTP_FROM=$VW_SMTP_FROM SMTP_FROM_NAME="$VW_SMTP_FROM_NAME" diff --git a/src/zabbix/constants-service.conf b/src/zabbix/constants-service.conf index 5dbe68c..e88cac4 100644 --- a/src/zabbix/constants-service.conf +++ b/src/zabbix/constants-service.conf @@ -33,4 +33,7 @@ ZABBIX_DB_NAME="zabbix" ZABBIX_DB_USR="zabbix" # Build a strong password for the SQL user - could be overwritten with something fixed -ZABBIX_DB_PWD="$(random_password)" \ No newline at end of file +ZABBIX_DB_PWD="$(random_password)" + +# service dependent meta tags +SERVICE_TAGS="php-fpm,nginx,postgresql" \ No newline at end of file diff --git a/src/zammad/constants-service.conf b/src/zammad/constants-service.conf index 59f06b1..d4e5885 100644 --- a/src/zammad/constants-service.conf +++ b/src/zammad/constants-service.conf @@ -20,4 +20,7 @@ LXC_UNPRIVILEGED="1" LXC_NESTING="1" # Defines the amount of RAM in MB your LXC container is allowed to use (default: 1024) -LXC_MEM="4096" \ No newline at end of file +LXC_MEM="4096" + +# service dependent meta tags +SERVICE_TAGS="nginx,postgresql,elasticsearch" \ No newline at end of file diff --git a/src/zmb-ad-join/constants-service.conf b/src/zmb-ad-join/constants-service.conf index de68731..244db4c 100644 --- a/src/zmb-ad-join/constants-service.conf +++ b/src/zmb-ad-join/constants-service.conf @@ -20,3 +20,6 @@ LXC_UNPRIVILEGED="0" LXC_NESTING="1" OPTIONAL_FEATURES=(wsdd splitdns) + +# service dependent meta tags +SERVICE_TAGS="nginx,samba,dns,ntp,dc,ldap,secondary" \ No newline at end of file diff --git a/src/zmb-ad/constants-service.conf b/src/zmb-ad/constants-service.conf index 415ffd0..ec5cea6 100644 --- a/src/zmb-ad/constants-service.conf +++ b/src/zmb-ad/constants-service.conf @@ -29,4 +29,7 @@ LXC_NESTING="1" # Example: # OPTIONAL_FEATURES=(wsdd) # OPTIONAL_FEATURES=(wsdd splitdns) -OPTIONAL_FEATURES=() \ No newline at end of file +OPTIONAL_FEATURES=(wsdd splitdns) + +# service dependent meta tags +SERVICE_TAGS="nginx,samba,dns,ntp,dc,ldap,primary" \ No newline at end of file diff --git a/src/zmb-member/constants-service.conf b/src/zmb-member/constants-service.conf index e650fc8..12d46e5 100644 --- a/src/zmb-member/constants-service.conf +++ b/src/zmb-member/constants-service.conf @@ -17,4 +17,7 @@ LXC_MP="1" LXC_UNPRIVILEGED="0" # enable nesting feature -LXC_NESTING="1" \ No newline at end of file +LXC_NESTING="1" + +# service dependent meta tags +SERVICE_TAGS="samba,member,fileserver" \ No newline at end of file diff --git a/src/zmb-standalone/constants-service.conf b/src/zmb-standalone/constants-service.conf index e650fc8..b71b870 100644 --- a/src/zmb-standalone/constants-service.conf +++ b/src/zmb-standalone/constants-service.conf @@ -17,4 +17,7 @@ LXC_MP="1" LXC_UNPRIVILEGED="0" # enable nesting feature -LXC_NESTING="1" \ No newline at end of file +LXC_NESTING="1" + +# service dependent meta tags +SERVICE_TAGS="samba,nfs,standalone,fileserver,cockpit" \ No newline at end of file