fix(general): Only add database service if available

This commit is contained in:
jeanluc
2022-05-11 11:08:48 +02:00
parent a2ddc1c1a1
commit 06bb925fb3
2 changed files with 2 additions and 3 deletions

View File

@@ -101,7 +101,7 @@
{%- if mapdata.config | traverse("database:db_type", "mysql") in ["mysql", "postgres", "mssql"] -%}
{%- set db_type = mapdata.config | traverse("database:db_type", "mysql") -%}
{%- if db_type not in mapdata.service.wants -%}
{%- if db_type not in mapdata.service.wants and salt["service.available"](db_type) -%}
{#- MariaDB usually provides `mysql.service` as well. -#}
{%- do mapdata.service.wants.append(db_type) -%}
{%- endif -%}