odoo/setup/odoo-playboook/roles/odoo/tasks/wkhtmltox.yml

30 lines
1.2 KiB
YAML

---
- name: Detect Debian architecture (i386 or amd64)
set_fact: odoo_debian_arch={{ '64' in ansible_architecture and 'amd64' or 'i386' }}
- name: Download wkhtmltox
get_url: url={{ item }}
dest={{ odoo_wkhtmltox_dest }}
with_items: "{{ odoo_wkhtmltox_urls }}"
ignore_errors: True
when: odoo_wkhtmltox_version is defined and odoo_wkhtmltox_version != False
# Use to detect that the package was downloaded.
# We can not register the result of the previous task to check this as Ansible
# will flag it as failed as soon as one URL fails (even if the download has
# worked on a further URL)
- name: Check wkhtmltox package
stat: path={{ odoo_wkhtmltox_dest }}
register: odoo_wkhtmltox_pkg
- name: Install wkhtmltox dependencies
apt: pkg={{ item }}
with_items: "{{ odoo_wkhtmltox_depends }}"
when: odoo_wkhtmltox_version is defined and odoo_wkhtmltox_version != False and odoo_wkhtmltox_pkg.stat.exists
- name: Install wkhtmltox
apt: deb="/root/wkhtmltox-{{ odoo_wkhtmltox_version }}_linux-{{ ansible_distribution_release }}-{{ odoo_debian_arch }}.deb"
force=yes
when: odoo_wkhtmltox_version is defined and odoo_wkhtmltox_version != False and odoo_wkhtmltox_pkg.stat.exists