Variable name consistence
This could be more consistent:
kimai_dbname: "{% if vhost.value.kimai_dbname is defined %}{{ vhost.value.kimai_dbname }}{% else %}{{ user.value.users_mariadb_databases[0] }}{% endif %}"
kimai_dbuser: "{{ vhost.value.kimai_dbuser | default(user.key) }}"
kimai_dbpass: "{{ users_mariadb_password_read.stdout | trim | quote }}"
kimai_dbprefix: "{{ vhost.value.kimai_dbprefix | default('') }}"
nextcloud_dbname: "{% if vhost.value.nextcloud_dbname is defined %}{{ vhost.value.nextcloud_dbname }}{% else %}{{ user.value.users_mariadb_databases[0] }}{% endif %}"
nextcloud_dbuser: "{{ vhost.value.nextcloud_dbuser | default(user.key) }}"
nextcloud_dbpass: "{{ users_mariadb_password_read.stdout | trim | quote }}"
nextcloud_dbprefix: "{{ vhost.value.nextcloud_dbprefix | default('') }}"
matomo_db_username: "{{ user.key }}"
matomo_db_pass: "{{ users_mariadb_password_read.stdout | trim | quote }}"
matomo_db_host: localhost
matomo_dbname: "{% if vhost.value.matomo_dbname is defined %}{{ vhost.value.matomo_dbname }}{% else %}{{ user.value.users_mariadb_databases[0] }}{% endif %}"
phpmyadmin_db: "{% if vhost.value.phpmyadmin_db is defined %}{{ vhost.value.phpmyadmin_db }}{% else %}{{ user.value.users_mariadb_databases[0] }}{% endif %}"
phpmyadmin_db_user: "{{ user.key }}"
phpmyadmin_db_pass: "{{ users_mariadb_password_read.stdout | trim | quote }}"
phpmyadmin_db_socket: /var/run/mysqld/mysqld.sock
phpmyadmin_db_host: localhost
phpmyadmin_db_port: 3306