diff --git a/defaults/main.yml b/defaults/main.yml index 7806953..44feb74 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -120,4 +120,5 @@ odoo_role_dev_helpers: true # wkhtmltopdf version wkhtmltox_version_jammy: "0.12.6.1-2" wkhtmltox_version_bionic: "0.12.6-1" -wkhtmltox_version: "{% if ansible_distribution_release in ['jammy', 'bullseye'] %}{{ wkhtmltox_version_jammy }}{% else %}{{wkhtmltox_version_bionic}}{% endif %}" \ No newline at end of file +wkhtmltox_version_nobel: "0.12.6-2build2" +wkhtmltox_version: "{% if ansible_distribution_release in ['jammy', 'bullseye'] %}{{ wkhtmltox_version_jammy }}{% elif ansible_distribution_release == 'bionic' %}{{wkhtmltox_version_bionic}}{% else %}{{ wkhtmltox_version_nobel }}{% endif %}" diff --git a/tasks/main.yml b/tasks/main.yml index 2a4b8cf..383d489 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -44,7 +44,14 @@ - name: Download and install wkhtmltopdf only if not already present at any version apt: deb: "https://github.com/wkhtmltopdf/packaging/releases/download/{{ wkhtmltox_version }}/wkhtmltox_{{ wkhtmltox_version }}.{{ ansible_distribution_release }}_amd64.deb" - when: wkhtmltox_installed.rc == 1 + when: wkhtmltox_installed.rc == 1 and ansible_distribution_version < "24.04" + +- name: Install wkhtmltopdf only if not already present at any version + apt: + update_cache: true + pkg: + - "wkhtmltopdf={{ wkhtmltox_version }}" + when: wkhtmltox_installed.rc == 1 and ansible_distribution_version >= "24.04" - import_tasks: pyenv.yml become: true