ansible-odoo icon indicating copy to clipboard operation
ansible-odoo copied to clipboard

force the creation of odoo_workdir and odoo_rootdir

Open JordiBForgeFlow opened this issue 7 years ago • 5 comments

The parameters 'odoo_workdir', 'odoo_rootdir' and 'odoo_config_data_dir' are defaulted to be under /home/{odoo user} https://github.com/OCA/ansible-odoo/blob/bb855f416c640c21f1268b9dd6540b77a147466d/defaults/main.yml#L17

But that is not the correct to place applications, according to https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard. In /home one should store user's personal files, not applications.

In my opinion a better place, according to my interpretation of the filesystem hierarchy standard, should be: odoo_workdir: "/opt/odoo" odoo_rootdir: "/opt/odoo/server" odoo_config_data_dir: "/srv/odoo"

I can agree that this may not be necessarily the defaulted values. But the problem comes when I change the parameters to what I indicated above. In that case the playbook fails because there's no explicit task in the playbook that creates the odoo_workdir or odoo_rootdir.

In addition the odoo config file was hardcoded to be stored under /home/{odoo user}, but seems that /etc is generally a more accepted place to store config files. So I create a parameter 'odoo_config_file_dir' and force the existence during execution of the playbook.

JordiBForgeFlow avatar Jul 04 '18 21:07 JordiBForgeFlow

Buildout tests fixed.

sebalix avatar Jul 05 '18 12:07 sebalix

I have introduced some more changes according to your suggestions. My proposal is:

Filestore + downloaded modules and werkzeug sessions will be stored in {{ odoo_config_data_dir }}/{{ odoo_service }} (e.g. /srv/oca) Therefore we try to ensure that a directory {{ odoo_config_data_dir }}/{{ odoo_service }} exists and is owned by {{ odoo_user }}

Application will be stored in {{ odoo_rootdir }}/{{ odoo_service }}/server (e.g. /opt/oca/server) Therefore we try to ensure that a directory {{ odoo_rootdir }}/{{ odoo_service }}/server exists and is owned by {{ odoo_user }}

Configuration will be stored in {{ odoo_config_file_dir }}/{{ odoo_service }} (e.g. /etc/oca) Therefore we try to ensure that a directory {{ odoo_config_file_dir }}/{{ odoo_service }} exists and is owned by {{ odoo_user }}

Odoo working dir will be stored in {{ odoo_workdir }}/{{ odoo_service }} Therefore we try to ensure that a directory {{ odoo_workdir }}/{{ odoo_service }} exists and is owned by {{ odoo_user }}

JordiBForgeFlow avatar Jul 05 '18 13:07 JordiBForgeFlow

But odoo_config_data_dir is where the filestore + downloaded modules and werkzeug sessions are stored, they should not be saved under /etc/ but in /srv/odoo as you suggest, or /var/lib/odoo in Debian-like systems. Am I wrong?

sebalix avatar Jul 05 '18 13:07 sebalix

@sebalix Sorry, I corrected the texts.

JordiBForgeFlow avatar Jul 05 '18 13:07 JordiBForgeFlow

@sebalix Travis fails in some of the tests, but not sure if it is related to this changes.

JordiBForgeFlow avatar Jul 09 '18 12:07 JordiBForgeFlow