diff --git a/defaults/main.yml b/defaults/main.yml index 5ea7197..0afa25a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -63,8 +63,8 @@ odoo_config_geoip_database: /usr/share/GeoIP/GeoLiteCity.dat odoo_config_http_enable: True # >= 11.0 odoo_config_http_interface: '' # >= 11.0 odoo_config_http_port: 8069 # >= 11.0 -odoo_config_limit_memory_hard: 805306368 -odoo_config_limit_memory_soft: 671088640 +odoo_config_limit_memory_hard: 2684354560 +odoo_config_limit_memory_soft: 2147483648 odoo_config_limit_time_cpu: 60 odoo_config_limit_time_real: 120 odoo_config_limit_time_real_cron: -1 # >= 10.0 diff --git a/tasks/install.yml b/tasks/install.yml index 55271ff..e5554f3 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -22,6 +22,10 @@ tags: - odoo_log +- name: Create odoo data dir directory + file: path={{ odoo_config_data_dir }} state=directory + owner={{ odoo_user }} group={{ odoo_user }} force=yes + - name: Project repository already cloned? stat: path={{ odoo_repo_dest }} register: project_path diff --git a/templates/odoo-pip.init b/templates/odoo-pip.init index 6048aa3..c0bbe40 100644 --- a/templates/odoo-pip.init +++ b/templates/odoo-pip.init @@ -20,6 +20,7 @@ VIRTUALENV={{ odoo_pip_venv_path }} DAEMON={{ odoo_pip_odoo_bin_path }} NAME={{ odoo_service }} DESC={{ odoo_service }} +CONFIG={{ odoo_config_file }} LOGFILE={{ odoo_logdir }}/{{ odoo_service }}.log PIDFILE=/var/run/${NAME}.pid USER={{ odoo_user }} @@ -40,7 +41,7 @@ function _start() { # from the configuration file # Odoo: https://github.com/odoo/odoo/pull/13685 # OCB: https://github.com/OCA/OCB/pull/553 - start-stop-daemon --chdir=${WORKDIR} --start --quiet --pidfile $PIDFILE --chuid $USER:$USER --background --make-pidfile --exec $DAEMON -- --logfile $LOGFILE{{ odoo_config_server_wide_modules not in [False, 'None', ''] and ' --load=%s' % odoo_config_server_wide_modules or '' }} + start-stop-daemon --chdir=${WORKDIR} --start --quiet --pidfile $PIDFILE --chuid $USER:$USER --background --make-pidfile --exec $DAEMON -- --config $CONFIG --logfile $LOGFILE{{ odoo_config_server_wide_modules not in [False, 'None', ''] and ' --load=%s' % odoo_config_server_wide_modules or '' }} } function _stop() { diff --git a/templates/odoo-pip.service b/templates/odoo-pip.service index e6f33f9..12ee759 100644 --- a/templates/odoo-pip.service +++ b/templates/odoo-pip.service @@ -6,7 +6,7 @@ After=network.target Type=simple User={{ odoo_user }} WorkingDirectory={{ odoo_workdir }} -ExecStart={{ odoo_pip_odoo_bin_path }} +ExecStart={{ odoo_pip_odoo_bin_path }} --logfile {{ odoo_logdir }}/{{ odoo_service}}.log --config {{ odoo_config_file }} {% for name, value in odoo_init_env.iteritems() %} Environment={{ name }}={{ value }} {% endfor %} diff --git a/templates/odoo-standard.service b/templates/odoo-standard.service index acebc01..d50a617 100644 --- a/templates/odoo-standard.service +++ b/templates/odoo-standard.service @@ -7,9 +7,9 @@ Type=simple User={{ odoo_user }} WorkingDirectory={{ odoo_workdir }} {% if odoo_version | version_compare('10.0', '>=') %} -ExecStart={{ odoo_rootdir }}/odoo-bin --logfile {{ odoo_logdir }}/{{ odoo_service }}.log +ExecStart={{ odoo_rootdir }}/odoo-bin --logfile {{ odoo_logdir }}/{{ odoo_service }}.log --config {{ odoo_config_file }} {% else %} -ExecStart={{ odoo_rootdir }}/odoo.py --logfile {{ odoo_logdir }}/{{ odoo_service }}.log +ExecStart={{ odoo_rootdir }}/odoo.py --logfile {{ odoo_logdir }}/{{ odoo_service}}.log --config {{ odoo_config_file }} {% endif %} {% for name, value in odoo_init_env.iteritems() %} Environment={{ name }}={{ value }}