oca / ansible-odoo Goto Github PK
View Code? Open in Web Editor NEWAnsible role for Odoo
License: GNU General Public License v3.0
Ansible role for Odoo
License: GNU General Public License v3.0
Can I use the ansible to give such commands:
$ ./odoo-bin shell
$ from openerp.service import db
db.exp_create_database('dbname',False,'ru_RU','admin','admin')
or
$ ./odoo-bin -d dbname -i crm,sale --without-demo=all
If yes, then please help how it can be done.
Thanks!
It would be nice to automatically install git before executing the git actions.
Trying to bootstrap a new dev host for me results in an error because I forgot to manually install git, but the point of the role was to make everything automatic.
Hi! Would be interesting to define also a role that can be nicely integrated with this.
I have seen this:
https://github.com/ridingbytes/ridingbytes.ansible-odoo-playbook/blob/master/roles/ridingbytes_nginx/vars/main.yml
I will be looking into it more.
This task is in conflict with "Project repository already cloned?" (https://github.com/OCA/ansible-odoo/blob/master/tasks/install.yml#L29): if the data directory is created in the same place (or a subdirectory) where the project has to be cloned, the role detect that this one was already cloned and so do nothing.
Maybe we have to move the "Create odoo data directory" right after, I'll do a PR later to test that.
Replace the SysV init script by a systemd unit when systemd is available.
I looked at a few attempts at adding support for Odoo 12 and Ubuntu 18.04 bionic to the role, and found that the buildout part was the only non-trivial fix. It seems to depend on a development version of anybox.recipy.odoo, for which the last published release (1.9.2) is from 2016.
I'm perfectly happy using either of the two alternative install methods, so I'm not really well positioned to do a deep dive into buildout. Are people actively using buildout? Has buildout development moved to a place that's off my radar? If buildout has stalled, I'd like to propose adding Odoo 12 with a footnote that buildout is not supported for now.
Travis is happy for the pip and standard builds, so I was wondering what the best way forward would be.
Hello,
I'm unable to install oca.odoo role via Ansible Galaxy :
$ ansible-galaxy install oca.odoo
- downloading role 'odoo', owned by oca
[WARNING]: - oca.odoo was NOT installed successfully: - sorry, oca.odoo was not found on https://galaxy.ansible.com.
No role is found from author "oca".
Any idea?
Thx.
http://docs.ansible.com/ansible/include_vars_module.html
Can be used to set the package dependencies adapted to the Odoo version, distribution release, wkhtmltox version, etc.
As per odoo/odoo#3234, we have to install a bunch of extra fonts for the barcodes to be printed on the standard reports.
The fonts must be downloaded from the upstream reportlab website directly.
Needed to print reports: http://wkhtmltopdf.org/
It would be nice to be able to set a list of OCA projects we want to deploy, and have them automatically cloned from github.
I see the above error in my postgres log (/var/log/postgresql/postgresql-9.3-main.log).
Upon investigation I find I can easily fix it by setting the max_cron_threads config variable to 1.
- odoo_config_max_cron_threads: 1
My question is why it's defaulted to 2 in this ansible role?
Odoo 9
PostgreSQL 9.3
Hi there !
This repo is fantastic, thanks for sharing your work (and your knowledge of ansible, especially).
I was wondering, as cloning the Odoo repo is one of the most intensive task of the playbook, why don't you set depth=1
in the install task ?
I noticed that when we download deb files (ie. wkhtmltopdf) we put them in /root and it can't be overridden.
I think we should put them in /opt/<software-name>
instead, which would be more suited according to the FHS.
If I'm not mistaken, the tag "odoo" is set on every task of the main file.
Wouldn't we run the playbook without tags instead if we want to run the whole file?
I am trying to deploy odoo in AWS with an RDS instance.
As such, my setup is the following (if you want I can push the packer + terraform files when all will be working):
odoo_config_db_host
is set to a record which doesn't exists yet (eg: odoo-db.ndd.tld)odoo_init
set to False
as the AMI is build before any resources are not ready yetansible-playbook (...) --skip-tags='odoo_postgresql'
because the RDS instance is not ready at this timeansible-playbook --tags='odoo_postgresql,odoo_service'
with extra_vars: odoo_init: True
My issues:
But thank you for thinking of the CREATE EXTENSION IF NOT EXISTS
๐ , this is indeed needed when creating immutable builds (aKa: an AMI which doesn't have side-effects when resources already exists so that we can redeploy at wish at every change).
At the moment, "Generate systemd Odoo service (standard)" in tasks/service.yml will notify: Restart Odoo so that the handler that restarts the odoo service is called.
This is not sufficient IMHO.
If a change to systemd services occurs, we get a Warning: odoo.service changed on disk. Run 'systemctl daemon-reload' to reload units. With ansible, we can achieve a daemon-reload with a new handler
- name: Restart systemd
systemd: daemon_reload=yes
that we place in handlers/main.yml. A change caused by service.yml should then notify both Restart Odoo and Restart systemd.
Please verify / dicuss, I am not the expert here.
Currently if you have an existing installation that contains an OCA module installed using pip, that perhaps was installed referring to a PR, and then this PR is merged into OCA, you may get this situation when you do pip install -r requirements.txt:
What to do? (s)witch, (i)gnore, (w)ipe, (b)ackup
The problem is that ansible runs all the steps automatically, and this one is treated as an error.
Perhaps in the ansible role we should always wipe all the OCA modules every time, or force update of them all?
One thing I do not like with the ansible approach is that in general, as the ansible role evolves, the old packages, python modules, etc.. are not going to be removed. This is something that Docker does better, as it creates from scratch every time, ensuring that there's no artifact sitting in the server that is not included in the configuration files.
cc @sbidoul perhaps you know how to force the pip install to always wipe the old pip module?
When I use this role for installation, the server starts up and gives me the database creation screen no problem. However, I get the following error when trying to create a database. Does anyone have any insight?
2015-08-20 16:23:50,204 14193 INFO None openerp.service.db: Create database `first`.
2015-08-20 16:23:51,062 14193 ERROR None openerp.sql_db: bad query: INSERT INTO ir_module_module (author, website, name, shortdesc, description, category_id, auto_install, state, web, license, application, icon, sequence, summary) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING id
Traceback (most recent call last):
File "/home/odoo/odoo/server/openerp/sql_db.py", line 234, in execute
res = self._obj.execute(query, params)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 3: ordinal not in range(128)
2015-08-20 16:23:51,064 14193 ERROR None openerp.service.db: CREATE DATABASE failed:
When odoo_config_db_host is False, it seems like Ansible can't set up the PG user. Looks like it can't delegate the task from the host to itself.
I managed to work around this issue by setting odoo_config_db_host_user to the same as in "remote_user"
using --pre will ensure that the OCA modules are installed, even when they are not in stable version.
recommended by @sbidoul
Hi,
I'm unable to install psycogreen
on Stretch:
TASK [sebalix.odoo : Install Odoo dependencies (PyPi)]
*****************************************************************************************
failed: [145.239.194.108] (item=psycogreen) => {"changed": false, "cmd": "/usr/bin/pip2 install psycogreen", "item": "psycogreen", "msg": "stdout: Collecting psycogreen\n Downloading https://files.pythonhosted.org/packages/66/29/9250c6a11822f56a1c2f703e4031d173c5b3725095d3422c11cafcc5427f/psycogreen-1.0.tar.gz\n Complete output from command python setup.py egg_info:\n Traceback (most recent call last):\n File \"<string>\", line 1, in <module>\n ImportError: No module named setuptools\n \n ----------------------------------------\n\n:stderr: Command \"python setup.py egg_info\" failed with error code 1 in /tmp/pip-build-kxCSb9/psycogreen/\n"}
Adding python-setuptools
to odoo_required_tools
fixes the issue.
I could make a PR if ok.
I'm on Ansible 2.1 (Ubuntu 16.04) and I find the following error when I try to use this role.
I've tried setting odoo_user_sshkeys:
to False, 0, "False", but I just get variations on the same error.
TASK [sebalix.odoo : Set SSH public keys for the Odoo user] ********************
task path: /etc/ansible/roles/sebalix.odoo/tasks/install_extra.yml:3
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 93, in run
items = self._get_loop_items()
File "/usr/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 195, in _get_loop_items
items = self._shared_loader_obj.lookup_loader.get(self._task.loop, loader=self._loader, templar=templar).run(terms=loop_terms, variables=self._job_vars, wantlist=True)
File "/usr/lib/python2.7/dist-packages/ansible/plugins/lookup/fileglob.py", line 33, in run
term_file = os.path.basename(term)
File "/usr/lib/python2.7/posixpath.py", line 114, in basename
i = p.rfind('/') + 1
AttributeError: 'bool' object has no attribute 'rfind'
fatal: [eagle]: FAILED! => {"failed": true, "msg": "Unexpected failure during module execution.", "stdout": ""}
Sorry another issue with the role:
This time it's about NodeJS dependency phantomjs-prebuit
:
TASK [sebalix.odoo : Install Odoo dependencies (npm)]
******************************************************************************************
changed: [145.239.194.108] => (item={'name': 'less', 'version': '2.7.2'})
changed: [145.239.194.108] => (item={'name': 'less-plugin-clean-css', 'version': '1.5.1'})
failed: [145.239.194.108] (item={'name': 'phantomjs-prebuilt', 'version': '2.1.15'}) => {"changed": false, "cmd": "/usr/bin/npm install --global ''", "item": {"name": "phantomjs-prebuilt", "version": "2.1.15"}, "msg": "Error extracting archive\nPhantom installation failed { Error:********@2.1.15 install script 'node install.js'.\nnpm ERR! Make sure you have the latest version of node.js and npm installed.\nnpm ERR! If you do, this is most likely a problem with the phantomjs-prebuilt package,\nnpm ERR! not with npm itself.\nnpm ERR! Tell the author that this fails on your system:\nnpm ERR! node install.js\nnpm ERR! You can get information on how to open an issue for this project with:\nnpm ERR! npm bugs phantomjs-prebuilt\nnpm ERR! Or if that isn't available, you can get their info via:\nnpm ERR! npm owner ls phantomjs-prebuilt\nnpm ERR! There is likely additional logging output above.\n\nnpm ERR! Please include the following file with any support request:\nnpm ERR! /home/debian/npm-debug.log", "rc": 1, "stderr": "Error extracting archive\nPhantom installation failed { Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2\ntar (child): bzip2: Cannot exec: No such file or directory\ntar (child): Error is not recoverable: exiting now\ntar: Child returned status 2\ntar: Error is not recoverable: exiting now\n\n at ChildProcess.exithandler (child_process.js:199:12)\n at emitTwo (events.js:106:13)\n at ChildProcess.emit (events.js:191:7)\n at maybeClose (internal/child_process.js:920:16)\n at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)\n killed: false,\n code: 2,\n signal: null,\n cmd: 'tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2' } Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2\ntar (child): bzip2: Cannot exec: No such file or directory\ntar (child): Error is not recoverable: exiting now\ntar: Child returned status 2\ntar: Error is not recoverable: exiting now\n\n at ChildProcess.exithandler (child_process.js:199:12)\n at emitTwo (events.js:106:13)\n at ChildProcess.emit (events.js:191:7)\n at maybeClose (internal/child_process.js:920:16)\n at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)\nnpm ERR! Linux 4.9.0-6-amd64\nnpm ERR! argv \"/usr/bin/node\" \"/usr/bin/npm\" \"install\" \"--global\" \"[email protected]\"\nnpm ERR! node v6.14.3\nnpm ERR! npm v3.10.10\nnpm ERR! code ELIFECYCLE\n\nnpm ERR! [email protected] install: `node install.js`\nnpm ERR! Exit status 1\nnpm ERR! \nnpm ERR! Failed at the [email protected] install script 'node install.js'.\nnpm ERR! Make sure you have the latest version of node.js and npm installed.\nnpm ERR! If you do, this is most likely a problem with the phantomjs-prebuilt package,\nnpm ERR! not with npm itself.\nnpm ERR! Tell the author that this fails on your system:\nnpm ERR! node install.js\nnpm ERR! You can get information on how to open an issue for this project with:\nnpm ERR! npm bugs phantomjs-prebuilt\nnpm ERR! Or if that isn't available, you can get their info via:\nnpm ERR! npm owner ls phantomjs-prebuilt\nnpm ERR! There is likely additional logging output above.\n\nnpm ERR! Please include the following file with any support request:\nnpm ERR! /home/debian/npm-debug.log\n", "stderr_lines": ["Error extracting archive", "Phantom installation failed { Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2", "tar (child): bzip2: Cannot exec: No such file or directory", "tar (child): Error is not recoverable: exiting now", "tar: Child returned status 2", "tar: Error is not recoverable: exiting now", "", " at ChildProcess.exithandler (child_process.js:199:12)", " at emitTwo (events.js:106:13)", " at ChildProcess.emit (events.js:191:7)", " at maybeClose (internal/child_process.js:920:16)", " at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)", " killed: false,", " code: 2,", " signal: null,", " cmd: 'tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2' } Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2", "tar (child): bzip2: Cannot exec: No such file or directory", "tar (child): Error is not recoverable: exiting now", "tar: Child returned status 2", "tar: Error is not recoverable: exiting now", "", " at ChildProcess.exithandler (child_process.js:199:12)", " at emitTwo (events.js:106:13)", " at ChildProcess.emit (events.js:191:7)", " at maybeClose (internal/child_process.js:920:16)", " at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)", "npm ERR! Linux 4.9.0-6-amd64", "npm ERR! argv \"/usr/bin/node\" \"/usr/bin/npm\" \"install\" \"--global\" \"[email protected]\"", "npm ERR! node v6.14.3", "npm ERR! npm v3.10.10", "npm ERR! code ELIFECYCLE", "", "npm ERR! [email protected] install: `node install.js`", "npm ERR! Exit status 1", "npm ERR! ", "npm ERR! Failed at the [email protected] install script 'node install.js'.", "npm ERR! Make sure you have the latest version of node.js and npm installed.", "npm ERR! If you do, this is most likely a problem with the phantomjs-prebuilt package,", "npm ERR! not with npm itself.", "npm ERR! Tell the author that this fails on your system:", "npm ERR! node install.js", "npm ERR! You can get information on how to open an issue for this project with:", "npm ERR! npm bugs phantomjs-prebuilt", "npm ERR! Or if that isn't available, you can get their info via:", "npm ERR! npm owner ls phantomjs-prebuilt", "npm ERR! There is likely additional logging output above.", "", "npm ERR! Please include the following file with any support request:", "npm ERR! /home/debian/npm-debug.log"], "stdout": "/usr/bin/phantomjs -> /usr/lib/node_modules/phantomjs-prebuilt/bin/phantomjs\n\n> [email protected] install /usr/lib/node_modules/phantomjs-prebuilt\n> node install.js\n\nConsidering PhantomJS found at /usr/bin/phantomjs\nLooks like an `npm install -g`\nCould not link global install, skipping...\nDownloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2\nSaving to /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2\nReceiving...\n\nReceived 22866K total.\nExtracting tar contents (via spawned process)\n", "stdout_lines": ["/usr/bin/phantomjs -> /usr/lib/node_modules/phantomjs-prebuilt/bin/phantomjs", "", "> [email protected] install /usr/lib/node_modules/phantomjs-prebuilt", "> node install.js", "", "Considering PhantomJS found at /usr/bin/phantomjs", "Looks like an `npm install -g`", "Could not link global install, skipping...", "Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2", "Saving to /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2", "Receiving...", "", "Received 22866K total.", "Extracting tar contents (via spawned process)"]}
https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-stretch-amd64.deb
is now a 404.
Changing version var to 0.12.5 didn't fixed the issue since the new URL don't match the pattern (adding a "-1" and removing "-linux_"):
For instance with Stretch / amd64 :
https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb
In templates/odoo-9.0.init and templates/odoo-8.0.init, I suggest to replace this line :
LOGFILE={{ odoo_logdir }}/{{ odoo_service }}.log
by this line :
LOGFILE={{ odoo_config_logfile }}
Or even remove the line
Because otherwise the logfile parameter for the init daemon overwrite the logfile value in odoo config file
I get the following error more often than not, but not all the time.
TASK [sebalix.odoo-local : Local PostgreSQL - Active the 'unaccent' extension on databases] ***
task path: /home/daniel/dev/odoo/releasing-odoo/roles/sebalix.odoo-local/tasks/postgresql_local.yml:16
<178.62.35.198> ESTABLISH SSH CONNECTION FOR USER: root
<178.62.35.198> SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/daniel/.ansible/cp/ansible-ssh-%h-%p-%r 178.62.35.198 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /tmp/ansible-tmp-1472145122.31-245493941872480 `" && echo ansible-tmp-1472145122.31-245493941872480="` echo /tmp/ansible-tmp-1472145122.31-245493941872480 `" ) && sleep 0'"'"''
<178.62.35.198> PUT /tmp/tmpgWDE8m TO /tmp/ansible-tmp-1472145122.31-245493941872480/postgresql_ext
<178.62.35.198> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/daniel/.ansible/cp/ansible-ssh-%h-%p-%r '[178.62.35.198]'
<178.62.35.198> ESTABLISH SSH CONNECTION FOR USER: root
<178.62.35.198> SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/daniel/.ansible/cp/ansible-ssh-%h-%p-%r 178.62.35.198 '/bin/sh -c '"'"'chown -R postgres /tmp/ansible-tmp-1472145122.31-245493941872480/ && sleep 0'"'"''
<178.62.35.198> ESTABLISH SSH CONNECTION FOR USER: root
<178.62.35.198> SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/daniel/.ansible/cp/ansible-ssh-%h-%p-%r -tt 178.62.35.198 '/bin/sh -c '"'"'sudo -H -S -n -u postgres /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-tvayagltobrcmldhlseqqnbxktqmrhzp; LANG=en_GB.UTF-8 LC_ALL=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8 /usr/bin/python /tmp/ansible-tmp-1472145122.31-245493941872480/postgresql_ext'"'"'"'"'"'"'"'"' && sleep 0'"'"''
<178.62.35.198> ESTABLISH SSH CONNECTION FOR USER: root
<178.62.35.198> SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/daniel/.ansible/cp/ansible-ssh-%h-%p-%r 178.62.35.198 '/bin/sh -c '"'"'rm -f -r /tmp/ansible-tmp-1472145122.31-245493941872480/ > /dev/null 2>&1 && sleep 0'"'"''
ok: [eagle] => {"changed": false, "db": "template1", "invocation": {"module_args": {"db": "template1", "ext": "unaccent", "login_host": "", "login_password": "", "login_user": "postgres", "name": "unaccent", "port": "5432", "state": "present"}, "module_name": "postgresql_ext"}}
ERROR! Unexpected Exception: 'bool' object has no attribute 'split'
the full traceback was:
Traceback (most recent call last):
File "/usr/local/bin/ansible-playbook", line 86, in <module>
sys.exit(cli.run())
File "/usr/lib/python2.7/dist-packages/ansible/cli/playbook.py", line 154, in run
results = pbex.run()
File "/usr/lib/python2.7/dist-packages/ansible/executor/playbook_executor.py", line 146, in run
result = self._tqm.run(play=play)
File "/usr/lib/python2.7/dist-packages/ansible/executor/task_queue_manager.py", line 264, in run
play_return = strategy.run(iterator, play_context)
File "/usr/lib/python2.7/dist-packages/ansible/plugins/strategy/linear.py", line 226, in run
task_vars = self._variable_manager.get_vars(loader=self._loader, play=iterator._play, host=host, task=task)
File "/usr/lib/python2.7/dist-packages/ansible/vars/__init__.py", line 371, in get_vars
all_vars['ansible_delegated_vars'] = self._get_delegated_vars(loader, play, task, all_vars)
File "/usr/lib/python2.7/dist-packages/ansible/vars/__init__.py", line 516, in _get_delegated_vars
include_hostvars=False,
File "/usr/lib/python2.7/dist-packages/ansible/vars/__init__.py", line 264, in get_vars
all_vars = combine_vars(all_vars, host.get_vars())
File "/usr/lib/python2.7/dist-packages/ansible/inventory/host.py", line 132, in get_vars
results['inventory_hostname_short'] = self.name.split('.')[0]
AttributeError: 'bool' object has no attribute 'split'
I'm not sure if it might be something to do with lines (34 or 41 of tasks/main.yml](https://github.com/osiell/ansible-odoo/blob/master/tasks/main.yml#L34)??
Looks similar to
Style Compilation failed
and something else about web static.
(I wish I could give you the error but it only appeared once and then on reload it went away.)
I always get this error, along with a broken CSS page, sometimes a 'dependences missing: widget.root' browser console error, but lately I get no errors at all in the log, or in browser console, but still it looks broken. I always restart the odoo server.
I've tried updating:
I've tried blowing away and:
I've tried both standard install and buildout install. I've tried an older version of Odoo 10.0, and a custom forked repo on an older version of Odoo 11.0, and a bleeding edge official version. I've tried an ansible version and a non-ansible version
I have no idea what else to try. Ubuntu 16, Odoo 11.0
Keep in mind i've tried various versions, so perhaps there's something old that's leftover
It seems that the when statements are sometimes wrong :
tasks/main.yml :
- include: postgresql_local.yml
when: (odoo_config_db_host == 'False') or (odoo_config_db_host == 'localhost') or (odoo_config_db_host == '127.0.0.1')
tags:
- odoo
- odoo_postgresql
- odoo_postgresql_local
- include: postgresql_remote.yml
when: (odoo_config_db_host != 'False') and (odoo_config_db_host != 'localhost') and (odoo_config_db_host != '127.0.0.1')
tags:
- odoo
- odoo_postgresql
- odoo_postgresql_remote
The when statement is not a python statement. With this version I fixed a error on a split of a variable name.
I also had to comment the install_extra task because it was evaluated even with odoo_user_sshkeys set to False, and this was causing an error because fileglob receive a bool instead of a string.
Actually I'm wrong, it was not a when statement problem but a bug with delegate_to that is evaluated before the when, causing crash when db_host set to False. Fixed by setting db_host to 127.0.0.1 instead of False
Ansible recently made it so that "git: update=no" does not make a checkout anymore (ansible/ansible@28f6a18).
So currently the playbook does not deploy the git repo when configured for it.
Fails when installing dependencies. For Ubuntu 17.04 zesty the name changed to python-pypdf2
Same/similar issue to what's described here
I'm running this on Ubuntu LTS version 14.04
When I play this playbook on a debian stretch using this playbook:
`
I get errors like this at the time of trying to start odo
If you create a database in odoo with workers=0 it works. But then when you restart the server with workers>0 and access as https://10.0.3.47/web?debug=assets you will again get the same error.
Possible related errors:
odoo/docker#151
odoo/odoo#20158
Hi I am new to ansible. I am running this role and encountering an error i.e:
TASK: [odoo | Remote PostgreSQL - Add the Odoo user] **************************
skipping: [158.69.201.193]
TASK: [odoo | Local PostgreSQL - Add the Odoo user] ***************************
failed: [158.69.201.193] => {"failed": true, "parsed": false}
sudo: unknown user: postgres
sudo: unable to initialize policy plugin
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: auto-mux: Trying existing master
debug1: mux_client_request_session: master session id: 2
debug1: mux_client_request_session: master session id: 2
Shared connection to 158.69.201.193 closed.
FATAL: all hosts have already failed -- aborting
and my play book is :
TASK [sebalix.odoo : Download wkhtmltox] ***************************************
failed: [192.168.33.10] (item=http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-xenial-amd64.deb) => {"dest": "/root/wkhtmltox-0.12.1_linux-xenial-amd64.deb", "failed": true, "item": "http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-xenial-amd64.deb", "msg": "Request failed: ", "state": "absent", "url": "http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-xenial-amd64.deb"}
failed: [192.168.33.10] (item=http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb) => {"dest": "/root/wkhtmltox-0.12.1_linux-xenial-amd64.deb", "failed": true, "item": "http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb", "msg": "Request failed: ", "state": "absent", "url": "http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb"}
failed: [192.168.33.10] (item=http://nightly.odoo.com/extra/wkhtmltox-0.12.1_linux-xenial-amd64.deb) => {"dest": "/root/wkhtmltox-0.12.1_linux-xenial-amd64.deb", "failed": true, "item": "http://nightly.odoo.com/extra/wkhtmltox-0.12.1_linux-xenial-amd64.deb", "msg": "Request failed", "response": "HTTP Error 404: Not Found", "state": "absent", "status_code": 404, "url": "http://nightly.odoo.com/extra/wkhtmltox-0.12.1_linux-xenial-amd64.deb"}
OS: Ubuntu 16.04.2 LTS
Python: 2.7.12
Hello everybody,
I'm new with ansible, I have just cloned the ansible-odoo repo.
Now what are the steps to deploy odoo 11 on my server?
Kind regards
AFAIK it's not possible to put the ssh key of the repo in the buildout config file, like: [email protected]:aheficent/my_pricate_repo.git
However, if I put the hppts git address in the buildout config file, like, https://github.com/aheficent/my_private_repo.git I get an error:
fatal: could not read Username for 'https://github.com': No such device or address
Is it possible to setup ansible-odoo with buildouts with private repos?
Thanks in advance!
I get this error with the following playbook on Debian Jessie:
- hosts: p711-node
roles:
- role: odoo
odoo_version: 8.0
odoo_config_admin_passwd: AdminPassword
odoo_config_db_host: 192.168.192.13
odoo_config_db_user: odoo
odoo_config_db_passwd: SomePassword
The error happens in templates/odoo-8.0.conf
on the following line:
db_host = {{ odoo_config_db_host not in [False, 'localhost', '127.0.0.1'] and hostvars.get(odoo_config_db_host, {}).get('ansible_ssh_host') or odoo_config_db_host }}
It's the hostvars
expression. What was intended here?
Hello,
I am using vagrant with ubuntu xenial and I am trying to install Odoo 8. When I get to the "Download wkhtmltox" step it fails with a 404. The file wkhtmltox-0.12.1_linux-xenial-amd64.deb does not exist.
I believe something is broken with the odoo_wkhtmltox_urls, since there is not a package that uses ansible_distribution_name for the xenial case. I am not sure if the generic package could work.
On the repo readme file it says that Odoo 8, 9 and 10 works for Ubuntu 16.04. Any insight on how to make it work please?
Thank you.
An empty database created with the odoo_parameter
will make Odoo (by default) initialize it with the 'en_US' language on the first launch, this can be undesired/unintended.
Also, this role aims to just deploy Odoo, not to create a database.
This parameter was added at first to configure the unaccent PostgreSQL extension, but this one could be installed on the default template0
database, from which further Odoo databases will be created.
@clonedagain : are you using this option?
Hi,
I was wondering why I get no log on Stretch...
I'm a bit confused about what's in default/main.yml
and odoo-standard.service
template.
I guess odoo-standard.service
is the template for systemd.
It's prepared to use odoo_logfile
if defined:
ExecStart={{ odoo_rootdir }}/odoo-bin{{ odoo_logfile and ' --logfile %s' % odoo_logfile }} --config {{ odoo_config_file }}
But in default/main.yml
, odoo_logfile
var is always empty for systemd:
odoo_logfile: "{{ ansible_service_mgr != 'systemd' and ('/'.join([odoo_logdir, odoo_service]) + '.log') or ''}}"
The default for odoo_config_addons_path
creates two paths. Installation with odoo 10.0 does not seem to have the first path /home/*/odoo/server/openerp/addons
. Something about a non-existent directory causes odoo to not properly serve the static content like css and js.
odoo_config_addons_path:
- "/home/{{ odoo_user }}/odoo/server/openerp/addons"
- "/home/{{ odoo_user }}/odoo/server/addons"
Full error message:
TASK [ansible-odoo : Install Odoo dependencies (PyPi)] **************************************************
failed: [xyz.abc.254.6] (item=psycogreen) => {"changed": false, "item": "psycogreen", "msg": "Unable to find any of pip3 to use. pip needs to be installed."}
to retry, use: --limit @/home/joerg/Informatik/Programmierung/hansible/play_odoo.retry
As vanilla Ubuntus come with Python3 installed, I run ansible with ansible_python_interpreter=/usr/bin/python3
.
I am not sure if this is an ansible problem or if this Odoo role should take it into account.
One of the tasks, I get this error:
root@50255:~/ansible# ansible-playbook /etc/ansible/playbooks/base-odoo.yml
PLAY [Install odoo] ************************************************************
TASK [setup] *******************************************************************
ok: [*******************]
TASK [sebalix.odoo : Setting variables depending on the Odoo version] **********
ok: [*******************] => (item=/etc/ansible/roles/sebalix.odoo/templates/../vars/Odoo-8.yml)
TASK [sebalix.odoo : Setting variables depending on the distribution release] **
ok: [*******************] => (item=/etc/ansible/roles/sebalix.odoo/templates/../vars/Ubuntu.yml)
TASK [sebalix.odoo : Install required tools] ***********************************
changed: [*******************] => (item=[u'sudo', u'git', u'mercurial', u'python-pip'])
TASK [sebalix.odoo : Install Odoo dependencies] ********************************
changed: [*******************] => (item=[u'python-dev', u'python-psycopg2', u'python-simplejson', u'python-lxml', u'python-tz', u'python-imaging', u'python-yaml', u'python-reportlab', u'python-mako', u'python-pychart', u'python-werkzeug', u'python-dateutil', u'python-unittest2', u'python-mock', u'python-openid', u'python-docutils', u'python-feedparser', u'python-gdata', u'python-jinja2', u'python-psutil', u'python-pydot', u'python-webdav', u'python-vatnumber', u'python-vobject', u'python-xlwt', u'python-ldap', u'python-openssl', u'python-egenix-mxdatetime', u'python-zsi', u'python-requests', u'python-pypdf', u'python-decorator', u'python-passlib', u'python-babel', u'python-gevent'])
TASK [sebalix.odoo : Install Odoo dependencies (PyPi)] *************************
changed: [*******************] => (item=psycogreen)
TASK [sebalix.odoo : Check that '/usr/bin/nodejs' exists] **********************
skipping: [*******************]
TASK [sebalix.odoo : Check that '/usr/local/bin/node' exists] ******************
skipping: [*******************]
TASK [sebalix.odoo : Add symlink '/usr/local/bin/node'] ************************
skipping: [*******************]
TASK [sebalix.odoo : Install Odoo dependencies (npm)] **************************
skipping: [*******************] => (item=odoo_npm_packages)
TASK [sebalix.odoo : Add Odoo system user] *************************************
changed: [*******************]
TASK [sebalix.odoo : Create log directory] *************************************
changed: [*******************]
TASK [sebalix.odoo : Project repository already cloned?] ***********************
ok: [*******************]
TASK [sebalix.odoo : Clone project repository (Mercurial)] *********************
skipping: [*******************]
TASK [sebalix.odoo : Clone project repository (Git)] ***************************
changed: [*******************]
TASK [sebalix.odoo : Set SSH public keys for the Odoo user] ********************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'bool' object has no attribute 'rfind'
fatal: [*******************]: FAILED! => {"failed": true, "msg": "Unexpected failure during module execution.", "stdout": ""}
RUNNING HANDLER [sebalix.odoo : Restart Odoo] **********************************
to retry, use: --limit @/etc/ansible/playbooks/base-odoo.retry
PLAY RECAP *********************************************************************
******************* : ok=10 changed=6 unreachable=0 failed=1
E.g to deploy an Odoo instance using the OCA/connector
framework (ODOO_CONNECTOR_CHANNELS environment variable, etc).
Hello,
wkhtmltopdf has moved the downloads provider from SourceForge to gna.org. As mentioned in the linked message, all earlier downloads have been removed from SourceForge and you are strongly advised to migrate to the new URLs. The following files in your repository will need to be updated:
It is recommended to either subscribe to the mailing list or Twitter feed to receive updates on new releases and further changes.
Thanks,
wkhtmltopdf maintainer
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.