odoo.conf 1013 B

1234567891011121314151617181920212223242526272829
  1. {% macro conf(funcs, values) -%}
  2. [options]
  3. ; Paths
  4. data_dir = {{ values.consts.data_path }}
  5. addons_path = {{ values.consts.addons_path }}
  6. ; Network Details
  7. http_enable = True
  8. http_port = {{ values.network.web_port.port_number }}
  9. ; Database Details
  10. db_port = 5432
  11. db_sslmode = disable
  12. db_host = {{ values.consts.postgres_container_name }}
  13. db_name = {{ values.consts.db_name }}
  14. db_user = {{ values.consts.db_user }}
  15. db_password = {{ values.odoo.db_password }}
  16. {%- set keys = values.odoo.additional_conf | map(attribute="key") | list %}
  17. {%- if keys | length != keys | unique | list | length %}
  18. {%- do funcs.fail("Duplicate keys are not allowed in [odoo.additional_conf], but got [%s]" | format(keys | join(","))) %}
  19. {%- endif %}
  20. {%- for item in values.odoo.additional_conf %}
  21. {%- if item.key in values.consts.reserved_keys %}
  22. {%- do funcs.fail("The key [%s] is reserved and cannot be used." | format(item.key)) %}
  23. {%- endif %}
  24. {{ "%s = %s" | format(item.key, item.value) }}
  25. {%- endfor %}
  26. {% endmacro %}