-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
base: master
Are you sure you want to change the base?
Changes from all commits
c96fe54
0c6f02a
4a4e683
af4ef6d
2f7be35
3da087a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,10 +12,10 @@ odoo_init: True | |
odoo_init_env: {} | ||
#VAR1: value1 | ||
#VAR2: value2 | ||
odoo_logdir: "/var/log/{{ odoo_user }}" | ||
odoo_logdir: "/var/log" | ||
odoo_logfile: "{{ ansible_service_mgr != 'systemd' and ('/'.join([odoo_logdir, odoo_service]) + '.log') or ''}}" | ||
odoo_workdir: "/home/{{ odoo_user }}/odoo" | ||
odoo_rootdir: "{{ odoo_install_type == 'buildout' and '/home/'+odoo_user+'/odoo/parts/odoo' or '/home/'+odoo_user+'/odoo/server' }}" | ||
odoo_workdir: "/home/{{ odoo_user }}/{{ odoo_service }}" | ||
odoo_rootdir: "{{ '/home/'+odoo_user+'/'+odoo_service }}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem to add absolute paths in a variable, is that someone could set odoo_rootdir = /opt and screw everything, because it would add permissions on odoo for the whole /opt. |
||
|
||
# Project repository to deploy | ||
odoo_repo_type: git # git or hg | ||
|
@@ -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 }}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe use directly There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 }} There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do we document that? will adding - version: 2.0 just work? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" | ||
|
@@ -106,13 +107,13 @@ odoo_config_custom: {} | |
#your_option2: value2 | ||
|
||
# Pip installation options (odoo_install_type == 'pip') | ||
odoo_pip_venv_path: "{{ odoo_workdir }}/sandbox" | ||
odoo_pip_venv_path: "{{ odoo_workdir }}/{{ odoo_service }}/sandbox" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
odoo_pip_requirements_url: "file:///home/{{ odoo_user }}/requirements.txt" | ||
odoo_pip_odoo_bin_path: "{{ odoo_pip_venv_path }}/bin/{{ (odoo_version | int) < 10 and 'odoo.py' or 'odoo' }}" | ||
|
||
# Buildout installation options (odoo_install_type == 'buildout') | ||
odoo_buildout_version: 2.10.0 | ||
odoo_buildout_venv_path: "{{ odoo_workdir }}/sandbox" | ||
odoo_buildout_venv_path: "{{ odoo_workdir }}/{{ odoo_service }}/sandbox" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same remark. |
||
odoo_buildout_bootstrap_path: "{{ odoo_workdir }}/bootstrap.py" | ||
odoo_buildout_bootstrap_cmd: "{{ odoo_buildout_venv_path }}/bin/python {{ odoo_buildout_bootstrap_path }} -c {{ odoo_buildout_config_path }} --buildout-version {{ odoo_buildout_version }}" | ||
odoo_buildout_bin_path: "{{ odoo_workdir }}/bin/buildout" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
- odoo_install_ssh | ||
|
||
- name: Create log directory | ||
file: path={{ odoo_logdir }} state=directory | ||
file: path={{ odoo_logdir }}/{{ odoo_service }} state=directory | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If |
||
owner={{ odoo_user }} group={{ odoo_user }} force=no | ||
tags: | ||
- odoo_log | ||
|
@@ -62,8 +62,28 @@ | |
tags: | ||
- odoo_project | ||
|
||
- name: Create working dir directory | ||
file: path={{ odoo_workdir }}/{{ odoo_service }} state=directory | ||
owner={{ odoo_user }} group={{ odoo_user }} force=yes | ||
|
||
- name: Create odoo server directory | ||
file: path={{ odoo_rootdir }}/{{ odoo_service }}/server 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 }}/{{ odoo_service }} state=directory | ||
owner={{ odoo_user }} group={{ odoo_user }} force=yes | ||
when: odoo_install_type != 'buildout' | ||
tags: | ||
- odoo_install_type_pip | ||
- odoo_install_type_standard | ||
|
||
- name: Create odoo data dir directory | ||
file: path={{ odoo_config_data_dir }} state=directory | ||
file: path={{ odoo_config_data_dir }}/{{ odoo_service }} state=directory | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same remark as for the "Create log directory" task / |
||
owner={{ odoo_user }} group={{ odoo_user }} force=yes | ||
when: odoo_install_type != 'buildout' | ||
tags: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,7 +96,7 @@ odoo_buildout_build_dependencies: | |
- libwebp-dev | ||
|
||
odoo_buildout_venv_cmd: "virtualenv --no-setuptools --python=python3 {{ odoo_buildout_venv_path }}" | ||
odoo_pip_venv_cmd: "virtualenv --python=python3 {{ odoo_pip_venv_path }}" | ||
º: "virtualenv --python=python3 {{ odoo_pip_venv_path }}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo. |
||
|
||
odoo_wkhtmltox_version: 0.12.4 | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove
{{ odoo_user }}
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because that's the base directory that will be used as the basis to create the specific odoo log directory, in the task:
file: path={{ odoo_logdir }}/{{ odoo_service }} state=directory
owner={{ odoo_user }} group={{ odoo_user }} force=no
tags:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So why not
odoo_logdir = "/var/log/{{ odoo_service }}"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because then someone could do odoo_logdir = "/var/log" by mistake, and then the role would change the permissions of the /var/log directory, that is shared.
The idea that I had in order to prevent this kind of errors is that the *dir variables point to the root dir. the final directory is root dir + {{ odoo_service }}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, {{ odoo_service }} will be used as a subdir of:
/{{ odoo_logdir }}/{{ odoo_service }} => For logs
/{{ odoo_workdir }}/{{ odoo_service }} => For work dir
/{{ odoo_rootdir }}/{{ odoo_service }}/server => For the server