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

Fix pip install + Others things #64

Merged
merged 5 commits into from
Jan 25, 2018
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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_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
Expand Down
8 changes: 7 additions & 1 deletion tasks/install_pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,28 @@
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
virtualenv: "{{ odoo_pip_venv_path }}"

notify: Restart Odoo

- import_tasks: config.yml
tags:
Expand Down
2 changes: 1 addition & 1 deletion templates/odoo-10.0-pip-requirements.txt
Original file line number Diff line number Diff line change
@@ -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/[email protected]#egg=odoo10_addon_date_range&subdirectory=setup/date_range
2 changes: 1 addition & 1 deletion templates/odoo-11.0-pip-requirements.txt
Original file line number Diff line number Diff line change
@@ -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/[email protected]#egg=odoo11_addon_date_range&subdirectory=setup/date_range
2 changes: 1 addition & 1 deletion templates/odoo-8.0-pip-requirements.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion templates/odoo-9.0-pip-requirements.txt
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 4 additions & 1 deletion vars/Debian-9_Odoo-10.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ odoo_debian_packages:
- python-pychart
- python-pydot
- python-pyparsing
- python-pypdf2
- python-reportlab
- python-requests
- python-six
Expand All @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion vars/Debian-9_Odoo-8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion vars/Debian-9_Odoo-9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down