server/node: Added support for specific environment variables

dehydrated
Felix Stupp 5 years ago
parent 34da73722c
commit 1f26debcf2
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -15,5 +15,7 @@ database_user: "{{ system_user | regex_replace('[^a-zA-Z]', '_') }}"
# database_pass from mysql/database # database_pass from mysql/database
# database_name from mysql/database # database_name from mysql/database
environment_vars: {}
install_command: "sudo -u {{ system_user | quote }} sh -c 'npm i && npm audit fix'" install_command: "sudo -u {{ system_user | quote }} sh -c 'npm i && npm audit fix'"
reload_command: "{{ install_command }} && systemctl restart {{ service_name | quote }}" reload_command: "{{ install_command }} && systemctl restart {{ service_name | quote }}"

@ -21,6 +21,9 @@ Environment="DATABASE_PORT=3306"
Environment="DATABASE_USERNAME={{ database_user }}" Environment="DATABASE_USERNAME={{ database_user }}"
Environment="DATABASE_PASSWORD={{ database_pass }}" Environment="DATABASE_PASSWORD={{ database_pass }}"
Environment="DATABASE_NAME={{ database_name }}" Environment="DATABASE_NAME={{ database_name }}"
{% for name, var in environment_vars.items() %}
Environment="{{ name }}={{ var }}"
{% endfor %}
TimeoutStartSec=2s TimeoutStartSec=2s
TimeoutStopSec=10s TimeoutStopSec=10s

Loading…
Cancel
Save