diff --git a/README.md b/README.md index 5ae8c799155310ea3db9431b108425d609fe6da2..f7751fba335d20ea2ae64d9e3755ede453eddb43 100644 --- a/README.md +++ b/README.md @@ -170,11 +170,31 @@ odoo_nonprod_instances_example: # To be renamed odoo_nonprod_instances - account_bank_statement_import_ofx extra_urls: - "docs-test.example.org" + ## OPTIONAL parameters for deploying another app (for instance a JS app) # extra_app: # - name: odootest_app # - image: nginx:latest # - url: app-test.example.org + + ## OPTIONAL - Allow access to Odoo DB from outside world + odoo_remote_db_access: false + + ## OPTIONAL - Extra commands to be added in Dockerfile building Odoo image + # odoo_specific_dockerfile_commands: [] + ## OPTIONAL - Extra host to be defined in Odoo docker /etc/hosts for local access and prevent DNS resolution + # odoo_extra_host: "docs.example.org:172.17.0.1" + ## OPTIONAL - update performance limits for Odoo (see https://www.odoo.com/documentation/14.0/developer/reference/cmdline.html) + # odoo_db_maxconn: 64 + # odoo_limit_time_cpu: 300 + # odoo_limit_time_real: 600 + ## OPTIONAL - Extra variables to be added in odoo.conf + # odoo_server_wide_modules: "queue_job" + # odoo_modules_auto_install_disabled: "stock_sms" + # odoo_modules_auto_install_enabled: "mail_tracking" + # odoo_extra_conf: "log_level = debug" + ## OPTIONAL - update performance limits for Odoo (see https://www.odoo.com/documentation/14.0/developer/reference/cmdline.html) + # postgres_options: "-c max_connections=100" ``` Also backups are designed to be performed only on prod instances, backups can however be restored on every non prod instance. diff --git a/defaults/main.yml b/defaults/main.yml index 7a726326131183f8f7e15789a0fd716d207ea6c1..d9b7fce6e507df145901417e6184dd46c9e9d570 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -97,6 +97,9 @@ odoo_remote_db_access: false # odoo_limit_time_cpu: 300 # odoo_limit_time_real: 600 ## OPTIONAL - Extra variables to be added in odoo.conf +# odoo_server_wide_modules: "queue_job" +# odoo_modules_auto_install_disabled: "stock_sms" +# odoo_modules_auto_install_enabled: "mail_tracking" # odoo_extra_conf: "log_level = debug" ## OPTIONAL - update performance limits for Odoo (see https://www.odoo.com/documentation/14.0/developer/reference/cmdline.html) # postgres_options: "-c max_connections=100" diff --git a/templates/odoo.conf.j2 b/templates/odoo.conf.j2 index ee0b26f61e624a94b7ac4b994689ebfa19fcb6c7..f641eff815a6f93430438d0038e175e97449234b 100644 --- a/templates/odoo.conf.j2 +++ b/templates/odoo.conf.j2 @@ -31,9 +31,12 @@ limit_time_real = {{ odoo_limit_time_real | default(600) }} ; logfile = None ; longpolling_port = 8072 ; max_cron_threads = 2 +modules_auto_install_disabled = account_edi,mail_bot,web_unsplash{% if odoo_modules_auto_install_disabled is defined %},{{ odoo_modules_auto_install_disabled }}{% endif %} +modules_auto_install_enabled = account_move_name_sequence,account_reconcile_show_boolean,account_reconciliation_widget,disable_odoo_online,mail_debrand,partner_disable_gravatar,partner_firstname,password_security,remove_login_links,remove_odoo_enterprise,web_responsive,web_no_bubble{% if odoo_modules_auto_install_enabled is defined %},{{ odoo_modules_auto_install_enabled }}{% endif %} ; osv_memory_age_limit = 1.0 ; osv_memory_count_limit = False proxy_mode = True +server_wide_modules = web,module_change_auto_install{% if odoo_server_wide_modules is defined %},{{ odoo_server_wide_modules }}{% endif %} ; smtp_password = False {% if mailname is defined %} ; smtp_port = 25 diff --git a/templates/prod.yaml.j2 b/templates/prod.yaml.j2 index 1d031c795cb5836b985c68c2152dede246ba9318..3ca6bb0c35eb00e1bc9b8f099652f7d1907e579d 100644 --- a/templates/prod.yaml.j2 +++ b/templates/prod.yaml.j2 @@ -97,6 +97,7 @@ services: MAIL_CANONICAL_DOMAINS: "{{ mailname }}" MAIL_NON_CANONICAL_DEFAULT: "{{ mailname }}" restart: unless-stopped + {% if restrict_internet_access %} {% if imap_mailserver is defined %} email_imap: @@ -131,6 +132,7 @@ services: TARGET: "{{ mailserver }}" PRE_RESOLVE: 1 restart: unless-stopped + {% endif %} {% else %} image: mailhog/mailhog @@ -138,10 +140,10 @@ services: restart: unless-stopped labels: co.elastic.logs/enabled: "false" + {% endif %} {% if restrict_internet_access and odoo_prod.extra_urls is defined %} {% for server in odoo_prod.extra_urls %} - {{ server.url }}: image: tecnativa/whitelist container_name: odoo_{{ server.url }} @@ -157,10 +159,10 @@ services: TARGET: "{{ server.url }}" PRE_RESOLVE: 1 restart: unless-stopped + {% endfor %} {% endif %} {% if metabase %} - metabase: image: metabase/metabase container_name: odoo_metabase @@ -181,9 +183,9 @@ services: restart: unless-stopped volumes: - metabase:/metabase-data:z + {% endif %} {% if odoo_prod.extra_app is defined %} - app: image: {{ odoo_prod.extra_app.image }} container_name: {{ odoo_prod.extra_app.name }} diff --git a/templates/test.yaml.j2 b/templates/test.yaml.j2 index 8f1763925130732e439fd7c68c69e75d11b20b30..315268133a81d344875391535e11a889d01a8eec 100644 --- a/templates/test.yaml.j2 +++ b/templates/test.yaml.j2 @@ -92,9 +92,9 @@ services: traefik.http.routers.{{ item.dir }}smtp.rule: "Host(`{{ item.url }}`) && PathPrefix(`/smtp/`)" traefik.http.routers.{{ item.dir }}smtp.service: "{{ item.dir }}smtp" traefik.http.services.{{ item.dir }}smtp.loadbalancer.server.port: "8025" + {% if restrict_internet_access and item.extra_urls is defined %} {% for url in item.extra_urls %} - {{ url }}: image: tecnativa/whitelist container_name: {{ item.dir }}_{{ url }} @@ -110,10 +110,10 @@ services: TARGET: "{{ url }}" PRE_RESOLVE: 1 restart: unless-stopped + {% endfor %} {% endif %} {% if item.extra_app is defined %} - app: image: {{ item.extra_app.image }} container_name: {{ item.extra_app.name }} @@ -127,6 +127,7 @@ services: traefik.http.routers.{{ item.extra_app.name | lower | regex_replace('_','') }}.rule: "Host(`{{ item.extra_app.url }}`)" traefik.http.routers.{{ item.extra_app.name | lower | regex_replace('_','') }}.service: "{{ item.extra_app.name | lower | regex_replace('_','') }}" traefik.http.services.{{ item.extra_app.name | lower | regex_replace('_','') }}.loadbalancer.server.port: "80" + {% endif %} networks: