diff options
Diffstat (limited to 'ansible/odoo/odoo.yml')
-rw-r--r-- | ansible/odoo/odoo.yml | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/ansible/odoo/odoo.yml b/ansible/odoo/odoo.yml index 6897034..d018bf8 100644 --- a/ansible/odoo/odoo.yml +++ b/ansible/odoo/odoo.yml @@ -1,5 +1,12 @@ - hosts: - numquam + vars: + container_name: odoo + docker_tag: trygvis/odoo:12 + # Maximum allowed CPU time per request (default 60). + limit_time_cpu: 120 + # Maximum allowed Real time per request (default 120). + limit_time_real: 500 tasks: - become: yes file: @@ -17,25 +24,29 @@ [Service] TimeoutStartSec=0 Restart=always - ExecStartPre=-/usr/bin/docker stop odoo - ExecStartPre=-/usr/bin/docker rm odoo - ExecStartPre=/usr/bin/docker pull odoo + ExecStartPre=-/usr/bin/docker stop {{ container_name }} + ExecStartPre=-/usr/bin/docker rm {{ container_name }} + ExecStartPre=/usr/bin/docker pull {{ docker_tag }} ExecStart=/usr/bin/docker run \ -e HOST=172.17.0.1 \ -e PORT=5432 \ -e USER=odoo \ -e PASSWORD=odoo \ + -e ADMIN_PASSWD={{ admin_passwd }} \ -p 8069:8069 \ --mount source=odoo-data,target=/var/lib/odoo \ --mount source=odoo-extra-addons,target=/mnt/extra-addons \ - --name odoo -t \ - odoo \ + -t \ + --name {{ container_name }} \ + {{ docker_tag }} \ --workers=5 \ --http-port=8069 \ --longpolling-port=8070 \ --email-from=odoo@trygvis.io \ --smtp=172.17.0.1 \ - --proxy-mode + --proxy-mode \ + --limit-time-cpu={{ limit_time_cpu }} \ + --limit-time-real={{ limit_time_real }} \ [Install] WantedBy=multi-user.target @@ -58,4 +69,4 @@ unit: docker.odoo.service enabled: yes state: restarted - when: service_file.changed + when: service_file.changed or force_restart |