Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

force the creation of odoo_workdir and odoo_rootdir #90

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ odoo_postgresql_extensions:
- unaccent

# Standard installation/configuration options (odoo_install_type == 'standard')
odoo_config_file: "/home/{{ odoo_user }}/{{ odoo_service }}.conf"
odoo_config_file_dir: "/home/{{ odoo_user }}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use directly {{ odoo_config_file | dirname}} to get the directory path without adding another user option.
Feel free to create a new variable in ./vars/main.yml if you want a variable odoo_config_file_dir, these options are not supposed to be change by the user.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion {{ odoo_config_file }} should only contain the name of the config file. Because if you want to specify a certain subdir for the odoo config file, how can you possibly create that dir?

Same as above, for any path that you indicate you need a step that ensures that this path exists and is assigned to the right user.

And in order to ensure that people do now screw the standard linux, the paths indicated in parameters would not be created directly, but /{{ odoo_service }}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand now, thank you, so we have to drop the compatibility to achieve this, it wasn't clear and I was trying to keep this compatible.
A major release number is also required for such change (./meta/main.yml, to update to 2.0?).

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be a problem, since it seems that ansible does not seem to support role versioning ansible/proposals#23

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was just to "warn" the users that this new version break the compatibility with the previous ones, nothing more :)

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we document that? will adding - version: 2.0 just work?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to document this change, you could add a page in the wiki telling how to stay compatible with old releases (list old variable values) and link it on the README? For the moment it's enough.

odoo_config_file: "{{ odoo_config_file_dir }}/{{ odoo_service }}.conf"
odoo_force_config: True
odoo_config_addons_path:
- "/home/{{ odoo_user }}/odoo/server/{{ (odoo_version | int) < 10 and 'openerp' or 'odoo' }}/addons"
Expand Down
16 changes: 16 additions & 0 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,22 @@
tags:
- odoo_project

- name: Create working dir directory
file: path={{ odoo_workdir }} state=directory
owner={{ odoo_user }} group={{ odoo_user }} force=yes

- name: Create odoo server directory
file: path={{ odoo_rootdir }} state=directory
owner={{ odoo_user }} group={{ odoo_user }} force=yes
when: odoo_install_type != 'pip'
tags:
- odoo_install_type_standard
- odoo_install_type_buildout

- name: Create odoo config file directory
file: path={{ odoo_config_file_dir }} state=directory
owner={{ odoo_user }} group={{ odoo_user }} force=yes
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This task should not be executed for buildout installation, as anybox.recipe.odoo is in charge to create the config file in its own directory (./etc/odoo.cfg by default.).


- name: Create odoo data dir directory
file: path={{ odoo_config_data_dir }} state=directory
owner={{ odoo_user }} group={{ odoo_user }} force=yes
Expand Down