diff --git a/docs/README.rst b/docs/README.rst index 1c21688..3ff1dd0 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -45,10 +45,9 @@ Special notes * The formula is currently Linux/systemd-centric. It should be relatively easy to provide the correct parameters and service file for other platforms though. * Since the formula skips the web installer, you will need to provide at least the database configuration. * You can optionally specify the secrets, but they can be autogenerated by Salt as well. In that case, they will be saved in a grain value. -* Secrets and database config will be written to the global config file, the rest into ``custom/conf/app.ini``. * All the paths are modifiable, find them in ``lookup:paths``. You should not need to set the corresponding values in your config, they are added automatically. * If Gitea requires mounts for some of the paths, you can specify them in ``service:requires_mount`` as a list. -* If Gitea requires a local service unit (e.g. database server), specify it/them in ``service:wants`` as a list. +* If Gitea requires a local service unit (e.g. Redis server), specify it/them in ``service:wants`` as a list. This formula will do its best to automatically add a locally running database service to this list. RST mod ^^^^^^^ diff --git a/gitea/post-map.jinja b/gitea/post-map.jinja index dce8708..10a9df6 100644 --- a/gitea/post-map.jinja +++ b/gitea/post-map.jinja @@ -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 -%}