2022-10-01 18:57:37 +02:00
|
|
|
[Unit]
|
|
|
|
After=risotto.target
|
|
|
|
|
|
|
|
[Service]
|
2023-06-23 08:12:05 +02:00
|
|
|
Environment="PGSSLROOTCERT={{ general.tls_cert_directory }}/postgresql.crt"
|
|
|
|
Environment="PGSSLCERT={{ general.tls_cert_directory }}/postgresql.crt"
|
|
|
|
Environment="PGSSLKEY={{ general.tls_key_directory }}/postgresql.key"
|
2022-10-01 18:57:37 +02:00
|
|
|
Environment="PGPASSFILE=/etc/odoo/postgresql.pass"
|
|
|
|
|
|
|
|
#if database not imported, imported it active addons
|
2023-06-23 08:12:05 +02:00
|
|
|
{% set addons = odoo_addons|join(',') %}
|
|
|
|
ExecStartPre=/usr/bin/bash -c '/usr/bin/psql --set=sslmode=verify-full -h {{ general.postgresql.pg_client_server_domainname }} -U {{ general.postgresql.pg_client_username }} {{ general.postgresql.pg_client_database }} -c "\dt account_account" 2>&1 | grep -vq "not find" || (echo "INIT DATABASE"; /usr/bin/odoo --config /etc/odoo/odoo.conf -i {{ addons }} --stop-after-init; echo "OK")'
|
2022-10-01 18:57:37 +02:00
|
|
|
#change default values in database
|
2023-02-27 12:23:45 +01:00
|
|
|
ExecStartPre=/usr/local/lib/sbin/config_odoo.py
|
2022-10-01 18:57:37 +02:00
|
|
|
|
|
|
|
ExecStart=
|
|
|
|
ExecStart=/usr/bin/odoo --config /etc/odoo/odoo.conf
|
|
|
|
TimeoutStartSec=360
|