From bf726fc58c19566293d63832874d1e9d714dc290 Mon Sep 17 00:00:00 2001 From: sebalix Date: Wed, 24 Jan 2018 11:04:55 +0100 Subject: [PATCH 1/5] [FIX] Fix 'odoo_pip_odoo_bin_path' option + Fix the Travis test checking that the service is running on http://localhost:8069 + Fix the description of 'pip' install type in README + Restart Odoo if the application of the pip requirements.txt file has triggered changes + Set the default 'odoo_version' to 11.0 --- README.md | 5 ++--- defaults/main.yml | 4 ++-- tasks/install_pip.yml | 2 +- tests/run.sh | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ae8a54d..54c45fb 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,8 @@ This role supports three types of installation: Odoo project from a Git/Hg repository. Odoo is configured with Ansible options (`odoo_config_*` ones). -* **pip**: install the Odoo dependencies from APT repositories and the -Odoo project and modules from a pip requirements.txt file. Odoo is configured -with Ansible options +* **pip**: install Odoo and its dependencies (modules and Python packages) +from a pip requirements.txt file. Odoo is configured with Ansible options (`odoo_config_*` ones). * **buildout**: build the Odoo project from a Git/Hg repository containing a diff --git a/defaults/main.yml b/defaults/main.yml index c66356c..8dd16ff 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,7 +1,7 @@ ansible_ssh_pipelining: true odoo_install_type: standard # standard, buildout -odoo_version: 8.0 +odoo_version: 11.0 odoo_service: odoo odoo_user: odoo odoo_user_passwd: odoo @@ -108,7 +108,7 @@ odoo_config_custom: {} # Pip installation options (odoo_install_type == 'pip') odoo_pip_venv_path: "{{ odoo_workdir }}/sandbox" odoo_pip_requirements_url: "file:///home/{{ odoo_user }}/requirements.txt" -odoo_pip_odoo_bin_path: "{{ odoo_workdir }}/sandbox/src/odoo/odoo-bin" +odoo_pip_odoo_bin_path: "{{ odoo_workdir }}/sandbox/bin/odoo" # Buildout installation options (odoo_install_type == 'buildout') odoo_buildout_version: 2.9.5 diff --git a/tasks/install_pip.yml b/tasks/install_pip.yml index 98c6da4..9d2ece3 100644 --- a/tasks/install_pip.yml +++ b/tasks/install_pip.yml @@ -34,7 +34,7 @@ requirements: /home/{{ odoo_user }}/requirements.txt extra_args: --upgrade virtualenv: "{{ odoo_pip_venv_path }}" - + notify: Restart Odoo - import_tasks: config.yml tags: diff --git a/tests/run.sh b/tests/run.sh index 558a0ea..6224b1a 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -37,5 +37,5 @@ grep -q 'changed=2.*failed=0' $output_log \ echo "== CHECK THE SERVICE STATUS ==" sudo -E service odoo-$ODOO_INSTALL_TYPE status || exit 1 -sleep 3 && wget http://localhost:8069 | exit 1 -sudo -E service odoo-$ODOO_INSTALL_TYPE stop || exit 1 +sleep 3 && if ! wget http://localhost:8069; then tail -n 100 /var/log/odoo/*.log && exit 1; fi +sudo -E service odoo-$ODOO_INSTALL_TYPE stop || exit 1 From 23b464fc1c0212f29cb6602ee9954fc269c6395c Mon Sep 17 00:00:00 2001 From: sebalix Date: Thu, 25 Jan 2018 14:08:33 +0100 Subject: [PATCH 2/5] [FIX] 'odoo_pip_odoo_bin_path' value related to 'odoo_version' --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 8dd16ff..fd82eec 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -108,7 +108,7 @@ odoo_config_custom: {} # Pip installation options (odoo_install_type == 'pip') odoo_pip_venv_path: "{{ odoo_workdir }}/sandbox" odoo_pip_requirements_url: "file:///home/{{ odoo_user }}/requirements.txt" -odoo_pip_odoo_bin_path: "{{ odoo_workdir }}/sandbox/bin/odoo" +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.9.5 From f11f76f8e9cd316bb81e54fa2b8f7cb9c75651e0 Mon Sep 17 00:00:00 2001 From: sebalix Date: Thu, 25 Jan 2018 14:48:28 +0100 Subject: [PATCH 3/5] [FIX] 'odoo_install_type: standard', fix 'odoo_config_addons_path' option + install PyPDF 1.13 on Debian Stretch for Odoo 8, 9 and 10 (not PyPDF2) --- defaults/main.yml | 2 +- vars/Debian-9_Odoo-10.yml | 5 ++++- vars/Debian-9_Odoo-8.yml | 5 ++++- vars/Debian-9_Odoo-9.yml | 5 ++++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index fd82eec..374a546 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -42,7 +42,7 @@ odoo_postgresql_extensions: odoo_config_file: "/home/{{ odoo_user }}/{{ odoo_service }}.conf" odoo_force_config: True odoo_config_addons_path: - - "/home/{{ odoo_user }}/odoo/server/{{ (odoo_version | int) < 9 and 'openerp' or 'odoo' }}/addons" + - "/home/{{ odoo_user }}/odoo/server/{{ (odoo_version | int) < 10 and 'openerp' or 'odoo' }}/addons" - "/home/{{ odoo_user }}/odoo/server/addons" odoo_config_admin_passwd: admin odoo_config_auto_reload: False diff --git a/vars/Debian-9_Odoo-10.yml b/vars/Debian-9_Odoo-10.yml index d6bf487..22dd6d2 100644 --- a/vars/Debian-9_Odoo-10.yml +++ b/vars/Debian-9_Odoo-10.yml @@ -29,7 +29,6 @@ odoo_debian_packages: - python-pychart - python-pydot - python-pyparsing - - python-pypdf2 - python-reportlab - python-requests - python-six @@ -42,6 +41,10 @@ odoo_debian_packages: - python-xlwt - python-yaml +odoo_pypi_packages: + - psycogreen + - pyPdf==1.13 + odoo_nodejs_apt_package: "nodejs=6.*" odoo_nodejs_apt_repo: "node_6.x" odoo_npm_packages: diff --git a/vars/Debian-9_Odoo-8.yml b/vars/Debian-9_Odoo-8.yml index d4d8897..f866544 100644 --- a/vars/Debian-9_Odoo-8.yml +++ b/vars/Debian-9_Odoo-8.yml @@ -31,12 +31,15 @@ odoo_debian_packages: - python-egenix-mxdatetime - python-zsi - python-requests - - python-pypdf2 - python-decorator - python-passlib - python-babel - python-gevent +odoo_pypi_packages: + - psycogreen + - pyPdf==1.13 + odoo_npm_packages: [] odoo_pip_dependencies: diff --git a/vars/Debian-9_Odoo-9.yml b/vars/Debian-9_Odoo-9.yml index 1dcbf9a..f1cef07 100644 --- a/vars/Debian-9_Odoo-9.yml +++ b/vars/Debian-9_Odoo-9.yml @@ -31,12 +31,15 @@ odoo_debian_packages: - python-egenix-mxdatetime - python-zsi - python-requests - - python-pypdf2 - python-decorator - python-passlib - python-babel - python-gevent +odoo_pypi_packages: + - psycogreen + - pyPdf==1.13 + odoo_nodejs_apt_package: "nodejs=0.10*" odoo_nodejs_apt_repo: "node_0.10" odoo_nodejs_apt_dist: "jessie" From 1bcf0cf83cb38fe512862aed89785d8bd6048977 Mon Sep 17 00:00:00 2001 From: sebalix Date: Thu, 25 Jan 2018 15:57:38 +0100 Subject: [PATCH 4/5] [FIX] 'odoo_install_type: pip', execute 'pip' related tasks as 'odoo_user' (not root) --- tasks/install_pip.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tasks/install_pip.yml b/tasks/install_pip.yml index 9d2ece3..f2c12a6 100644 --- a/tasks/install_pip.yml +++ b/tasks/install_pip.yml @@ -19,17 +19,23 @@ creates: "{{ odoo_pip_venv_path }}" - name: Download the pip requirements file + become: yes + become_user: "{{ odoo_user }}" get_url: url="{{ odoo_pip_requirements_url }}" force=yes dest="/home/{{ odoo_user }}/requirements.txt" - name: Install Odoo dependencies (PyPi) + become: yes + become_user: "{{ odoo_user }}" pip: name: "{{ item }}" virtualenv: "{{ odoo_pip_venv_path }}" with_items: "{{ odoo_pip_dependencies }}" - name: Install Odoo from pip external requirements file + become: yes + become_user: "{{ odoo_user }}" pip: requirements: /home/{{ odoo_user }}/requirements.txt extra_args: --upgrade From 917e5101dbd84d92dba3f6d4ea2aa2504e98160a Mon Sep 17 00:00:00 2001 From: sebalix Date: Thu, 25 Jan 2018 16:32:28 +0100 Subject: [PATCH 5/5] [FIX] 'odoo_install_type: pip', fix requirements.txt file to download the Odoo archive from https://nightly.odoo.com instead of https://github.com/odoo/odoo, the first contains all standard modules in the 'addons/' folder, not the second --- templates/odoo-10.0-pip-requirements.txt | 2 +- templates/odoo-11.0-pip-requirements.txt | 2 +- templates/odoo-8.0-pip-requirements.txt | 2 +- templates/odoo-9.0-pip-requirements.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/odoo-10.0-pip-requirements.txt b/templates/odoo-10.0-pip-requirements.txt index a91390c..ec2ba48 100644 --- a/templates/odoo-10.0-pip-requirements.txt +++ b/templates/odoo-10.0-pip-requirements.txt @@ -1,2 +1,2 @@ -https://github.com/odoo/odoo/archive/10.0.tar.gz#egg=odoo +https://nightly.odoo.com/10.0/nightly/src/odoo_10.0.latest.zip -e git+https://github.com/OCA/server-tools.git@10.0#egg=odoo10_addon_date_range&subdirectory=setup/date_range diff --git a/templates/odoo-11.0-pip-requirements.txt b/templates/odoo-11.0-pip-requirements.txt index 2e4ae58..2db5b98 100644 --- a/templates/odoo-11.0-pip-requirements.txt +++ b/templates/odoo-11.0-pip-requirements.txt @@ -1,2 +1,2 @@ -https://github.com/odoo/odoo/archive/11.0.tar.gz#egg=odoo +https://nightly.odoo.com/11.0/nightly/src/odoo_11.0.latest.zip -e git+https://github.com/OCA/server-ux.git@11.0#egg=odoo11_addon_date_range&subdirectory=setup/date_range diff --git a/templates/odoo-8.0-pip-requirements.txt b/templates/odoo-8.0-pip-requirements.txt index db5c32c..df2942c 100644 --- a/templates/odoo-8.0-pip-requirements.txt +++ b/templates/odoo-8.0-pip-requirements.txt @@ -1 +1 @@ -https://github.com/odoo/odoo/archive/8.0.tar.gz#egg=odoo +https://nightly.odoo.com/8.0/nightly/src/odoo_8.0.latest.zip diff --git a/templates/odoo-9.0-pip-requirements.txt b/templates/odoo-9.0-pip-requirements.txt index 3058eb2..17de28b 100644 --- a/templates/odoo-9.0-pip-requirements.txt +++ b/templates/odoo-9.0-pip-requirements.txt @@ -1 +1 @@ -https://github.com/odoo/odoo/archive/9.0.tar.gz#egg=odoo +https://nightly.odoo.com/9.0/nightly/src/odoo_9.0.latest.zip