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

[ADD] Odoo 16, Ubuntu 22.04 support. #3

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
33 changes: 17 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ Minimum Ansible Version: 2.4

## Supported versions and systems

| System / Odoo | 8.0 | 9.0 | 10.0 | 11.0 | 12.0 | 13.0 | 14.0 |
|---------------|-----|-----|------|------|------|------|------|
| Debian 8 | yes | yes | yes | - | - | - | - |
| Debian 9 | yes | yes | yes | yes | - | - | - |
| Ubuntu 14.04 | yes | yes | yes | - | - | - | - |
| Ubuntu 16.04 | yes | yes | yes | - | - | - | - |
| Ubuntu 18.04 | - | - | - | yes | yes | yes | - |
| Ubuntu 20.04 | - | - | - | - | - | yes | yes |
| System / Odoo | 8.0 | 9.0 | 10.0 | 11.0 | 12.0 | 13.0 | 14.0 | 16.0 |
|---------------|-----|-----|------|------|------|------|------|------|
| Debian 8 | yes | yes | yes | - | - | - | - | - |
| Debian 9 | yes | yes | yes | yes | - | - | - | - |
| Ubuntu 14.04 | yes | yes | yes | - | - | - | - | - |
| Ubuntu 16.04 | yes | yes | yes | - | - | - | - | - |
| Ubuntu 18.04 | - | - | - | yes | yes | yes | - | - |
| Ubuntu 20.04 | - | - | - | - | - | yes | yes | - |
| Ubuntu 22.04 | - | - | - | - | - | - | - | yes |

## Example (Playbook)

Expand All @@ -47,7 +48,7 @@ the same host):
become: yes
roles:
- role: odoo
odoo_version: 14.0
odoo_version: 16.0
odoo_config_admin_passwd: SuPerPassWorD

## Recommended directories
Expand Down Expand Up @@ -110,7 +111,7 @@ available from your Ansible inventory):
become: yes
roles:
- role: odoo
odoo_version: 14.0
odoo_version: 16.0
odoo_config_admin_passwd: SuPerPassWorD
odoo_config_db_host: pg_server
odoo_config_db_user: odoo
Expand Down Expand Up @@ -142,7 +143,7 @@ Here we set some options required by the ``connector`` framework:
become: yes
roles:
- role: odoo
odoo_version: 14.0
odoo_version: 16.0
odoo_repo_type: git
odoo_repo_url: https://SERVER/REPO
odoo_repo_rev: master
Expand Down Expand Up @@ -173,8 +174,8 @@ if Odoo version 12 is to be used:
roles:
- role: odoo
odoo_install_type: pip
odoo_version: 14.0
odoo_pip_requirements_url: https://raw.githubusercontent.com/OCA/sample-oca-pip-requirements/14.0/requirements.txt
odoo_version: 16.0
odoo_pip_requirements_url: https://raw.githubusercontent.com/OCA/sample-oca-pip-requirements/16.0/requirements.txt
odoo_config_admin_passwd: SuPerPassWorD
environment:
LC_ALL: en_US.UTF-8
Expand All @@ -194,7 +195,7 @@ by Buildout:
roles:
- role: odoo
odoo_install_type: buildout
odoo_version: 14.0
odoo_version: 16.0
odoo_repo_type: git
odoo_repo_url: https://github.com/osiell/odoo-buildout-example.git
odoo_repo_rev: "{{ odoo_version }}"
Expand All @@ -211,7 +212,7 @@ your Ansible inventory):
roles:
- role: odoo
odoo_install_type: buildout
odoo_version: 14.0
odoo_version: 16.0
odoo_repo_type: git
odoo_repo_url: https://github.com/osiell/odoo-buildout-example.git
odoo_repo_rev: "{{ odoo_version }}"
Expand Down Expand Up @@ -246,7 +247,7 @@ We just set the relevant options to tell Ansible the files to use with the
roles:
- role: odoo
odoo_install_type: buildout
odoo_version: 14.0
odoo_version: 16.0
odoo_repo_type: git
odoo_repo_url: https://SERVER/REPO
odoo_repo_rev: master
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ odoo_config_log_level: info
odoo_config_logfile: None
odoo_config_logrotate: False
odoo_config_longpolling_port: 8072
odoo_config_gevent_port: 8072
odoo_config_osv_memory_age_limit: 1.0
odoo_config_osv_memory_count_limit: False
odoo_config_max_cron_threads: 2
Expand Down
63 changes: 63 additions & 0 deletions templates/odoo-16.0.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[options]
{% if odoo_install_type == 'pip' %}
addons_path =
{% else %}
addons_path = {{ odoo_config_addons_path.__class__.__name__ == 'list' and odoo_config_addons_path | join(',') or odoo_config_addons_path }}
{% endif %}
admin_passwd = {{ odoo_config_admin_passwd }}
csv_internal_sep = {{ odoo_config_csv_internal_sep }}
data_dir = {{ odoo_config_data_dir }}
db_host = {{ odoo_config_db_host not in [False, 'localhost', '127.0.0.1'] and odoo_config_db_host in hostvars and hostvars[odoo_config_db_host].get('ansible_host') or odoo_config_db_host }}
db_maxconn = {{ odoo_config_db_maxconn }}
db_name = {{ odoo_config_db_name }}
db_password = {{ odoo_config_db_passwd }}
db_port = {{ odoo_config_db_port }}
db_sslmode = {{ odoo_config_db_sslmode }}
db_template = {{ odoo_config_db_template }}
db_user = {{ odoo_config_db_user }}
dbfilter = {{ odoo_config_dbfilter }}
demo = {}
email_from = {{ odoo_config_email_from }}
geoip_database = {{ odoo_config_geoip_database }}
gevent_port = {{ odoo_config_gevent_port }}
http_enable = {{ odoo_config_http_enable or odoo_config_xmlrpc }}
http_interface = {{ odoo_config_http_interface or odoo_config_xmlrpc_interface }}
http_port = {{ odoo_config_http_port or odoo_config_xmlrpc_port }}
import_partial =
limit_memory_hard = {{ odoo_config_limit_memory_hard }}
limit_memory_soft = {{ odoo_config_limit_memory_soft }}
limit_request = 8192
limit_time_cpu = {{ odoo_config_limit_time_cpu }}
limit_time_real = {{ odoo_config_limit_time_real }}
limit_time_real_cron = {{ odoo_config_limit_time_real_cron }}
list_db = {{ odoo_config_list_db }}
log_db = {{ odoo_config_log_db }}
log_db_level = warning
log_handler = :INFO
log_level = {{ odoo_config_log_level }}
logfile = {{ odoo_config_logfile }}
logrotate = {{ odoo_config_logrotate }}
max_cron_threads = {{ odoo_config_max_cron_threads }}
osv_memory_count_limit = {{ odoo_config_osv_memory_count_limit }}
pg_path = {{ odoo_config_pg_path }}
pidfile = {{ odoo_config_pidfile }}
proxy_mode = {{ odoo_config_proxy_mode }}
reportgz = False
server_wide_modules = {{ odoo_config_server_wide_modules }}
smtp_password = {{ odoo_config_smtp_password }}
smtp_port = {{ odoo_config_smtp_port }}
smtp_server = {{ odoo_config_smtp_server }}
smtp_ssl = {{ odoo_config_smtp_ssl }}
smtp_user = {{ odoo_config_smtp_user }}
syslog = {{ odoo_config_syslog }}
test_commit = False
test_enable = False
test_file = False
test_report_directory = False
translate_modules = {{ odoo_config_translate_modules }}
unaccent = {{ odoo_config_unaccent }}
without_demo = {{ odoo_config_without_demo }}
workers = {{ odoo_config_workers }}
{% for name in odoo_config_custom | sort %}
{{ name }} = {{ odoo_config_custom[name] }}
{% endfor %}
81 changes: 81 additions & 0 deletions templates/odoo-16.0.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/bin/bash
### BEGIN INIT INFO
# Provides: {{ odoo_service }}
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start odoo daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
## more info: http://wiki.debian.org/LSBInitScripts

. /lib/lsb/init-functions

PATH=/usr/local/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin
WORKDIR={{ odoo_workdir }}
DAEMON={{ odoo_serverdir }}/odoo-bin
NAME={{ odoo_service }}
DESC={{ odoo_service }}
CONFIG={{ odoo_config_file }}
LOGFILE={{ odoo_logfile }}
PIDFILE=/var/run/${NAME}.pid
USER={{ odoo_user }}
export LOGNAME=$USER
{% if odoo_init_env %}
# Custom environment variables
{% for name, value in odoo_init_env.items() | list %}
export {{ name }}={{ value }}
{% endfor %}
{% endif %}

test -x $DAEMON || exit 0
set -e

function _start() {
start-stop-daemon --chdir=${WORKDIR} --start --quiet --pidfile $PIDFILE --chuid $USER:$USER --background --make-pidfile --exec $DAEMON -- --config $CONFIG --logfile $LOGFILE
}

function _stop() {
start-stop-daemon --stop --quiet --pidfile $PIDFILE --oknodo --retry 3
rm -f $PIDFILE
}

function _status() {
start-stop-daemon --status --quiet --pidfile $PIDFILE
return $?
}


case "$1" in
start)
echo -n "Starting $DESC: "
_start
echo "ok"
;;
stop)
echo -n "Stopping $DESC: "
_stop
echo "ok"
;;
restart|force-reload)
echo -n "Restarting $DESC: "
_stop
sleep 1
_start
echo "ok"
;;
status)
echo -n "Status of $DESC: "
_status && echo "running" || echo "stopped"
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac

exit 0
87 changes: 87 additions & 0 deletions vars/Ubuntu-22_Odoo-16.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---

odoo_debian_packages:
- build-essential
- python3-dev
- python3-setuptools
- python3-xlwt
- libxml2
- libxml2-dev
- libxslt1-dev
- libldap2-dev
- libsasl2-dev
- libjpeg9-dev
- libpq-dev
- xz-utils
- python3-cffi

odoo_required_tools:
- sudo
- git
- python3-pip
- python3-psycopg2
- python3-setuptools

odoo_pip_executable: "pip3"
odoo_pypi_packages_requirements_file: True

odoo_pip_dependencies:
- wrapt
- setuptools-odoo
- odoo-autodiscover

odoo_pip_build_dependencies:
- python3-virtualenv
- build-essential
- python3-dev
- libxml2-dev
- libxslt1-dev
- libpq-dev
- libldap2-dev
- libsasl2-dev
- libopenjp2-7-dev
- libjpeg-turbo8-dev
- libtiff5-dev
- libfreetype6-dev
- liblcms2-dev
- libwebp-dev
- libssl-dev

odoo_buildout_build_dependencies:
- virtualenv
- build-essential
- python3-dev
- libxml2-dev
- libxslt1-dev
- libpq-dev
- libldap2-dev
- libsasl2-dev
- libopenjp2-7-dev
- libjpeg-turbo8-dev
- libtiff5-dev
- libfreetype6-dev
- liblcms2-dev
- libwebp-dev

odoo_buildout_venv_cmd: "python3 -m virtualenv --no-setuptools --python=python3 {{ odoo_buildout_venv_path }}"
odoo_pip_venv_cmd: "python3 -m virtualenv --python=python3 {{ odoo_pip_venv_path }}"

odoo_wkhtmltox_version: 0.12.6.1
odoo_wkhtmltox_urls:
- https://github.com/wkhtmltopdf/packaging/releases/download/{{ odoo_wkhtmltox_version }}-2/wkhtmltox_{{ odoo_wkhtmltox_version }}-2.{{ ansible_distribution_release }}_{{ odoo_debian_arch }}.deb

odoo_wkhtmltox_depends:
- fontconfig
- libfontconfig1
- libfreetype6
- zlib1g
- libx11-6
- libxext6
- libxrender1
- libjpeg-turbo8
- libfontenc1
- x11-common
- xfonts-75dpi
- xfonts-base
- xfonts-encodings
- xfonts-utils