From de1af44b7ffc96fe045388524402a0444104e4f3 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Wed, 26 Feb 2020 14:49:28 +0530 Subject: [PATCH 1/3] chore(playbooks): update wkhtmltopdf to v0.12.5 --- playbooks/roles/wkhtmltopdf/tasks/main.yml | 66 +++++++++++++++++++--- 1 file changed, 58 insertions(+), 8 deletions(-) diff --git a/playbooks/roles/wkhtmltopdf/tasks/main.yml b/playbooks/roles/wkhtmltopdf/tasks/main.yml index 59f5c736..d5fc71f8 100644 --- a/playbooks/roles/wkhtmltopdf/tasks/main.yml +++ b/playbooks/roles/wkhtmltopdf/tasks/main.yml @@ -20,16 +20,66 @@ force: yes when: ansible_os_family == 'Debian' -# wkhtmltopdf has been locked down to 0.12.3 intentionally since 0.12.4 has problems. -# I you want to upgrade try it on multiple platforms and then decide -- name: download wkthmltox linux - get_url: url=https://github.com/frappe/wkhtmltopdf/raw/master/wkhtmltox-0.12.3_linux-generic-{{ "amd64" if ansible_architecture == "x86_64" else "i386"}}.tar.xz dest=/tmp/wkhtmltox.tar.xz +- name: download wkthmltox Ubuntu 18 + get_url: + url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_{{ "amd64" if ansible_architecture == "x86_64" else "i386"}}.deb + dest: /tmp/wkhtmltox + checksum: '{{ db48fa1a043309c4bfe8c8e0e38dc06c183f821599dd88d4e3cea47c5a5d4cd3 if ansible_architecture == "x86_64" else 1f5ac84c1cb25e385b49b94a04807d60bf73da217bc6c9fe2cbd1f0a61d33f63 }}' + when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version == '14' -- name: Creates directory - file: path=/tmp/wkhtmltox state=directory +- name: download wkthmltox Ubuntu 16 + get_url: + url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.xenial_{{ "amd64" if ansible_architecture == "x86_64" else "i386"}}.deb + dest: /tmp/wkhtmltox + checksum: '{{ df203cee4dc9b3efb8d0cd6fc25fa819883224f50c75b76bd9c856903711dc14 if ansible_architecture == "x86_64" else 27b6edafee099b87b2911cc68b780e79cffed3948bb5a074e8ea1cf8820da156 }}' + when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version == '16' -- name: unarchive wkhtmltopdf - unarchive: src=/tmp/wkhtmltox.tar.xz dest=/tmp +- name: download wkthmltox Ubuntu 14 + get_url: + url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.trusty_{{ "amd64" if ansible_architecture == "x86_64" else "i386"}}.deb + dest: /tmp/wkhtmltox + checksum: '{{ 2a3d1fe80da0dbc69da56cf90a3d0ec2786d1b919be29527630d609fea4a6b7c if ansible_architecture == "x86_64" else 582e02881e4bc6be9aaa634da1fe8c02d3233fb57f6daab9efa137edb812dd3b }}' + when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version == '14' + +- name: download wkthmltox CentOS 6 + get_url: + url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox-0.12.5-1.centos6.{{ "x86_64" if ansible_architecture == "x86_64" else "i686"}}.rpm + dest: /tmp/wkhtmltox + checksum: '{{ 17bff4966143d240a126b6cc414c6f79aa2106c0c97c772228e84d685221c25f if ansible_architecture == "x86_64" else c60e75fef5bfa1e79983919ffb47b40dcfbb49d121a510f11ca4b2a2603c00f1 }}' + when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '6' + +- name: download wkthmltox CentOS 7 + get_url: + url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox-0.12.5-1.centos7.{{ "x86_64" if ansible_architecture == "x86_64" else "i686"}}.rpm + dest: /tmp/wkhtmltox + checksum: '{{ ac4f909b836fa1fc0188d19a1ab844910f91612e9ccefcb5298aa955a058ffe4 if ansible_architecture == "x86_64" else 1030279ac4b5b15dda04de2587b2a1942bde1c78aa1837dfec4ddcbea426721f }}' + when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7' + +- name: download wkthmltox CentOS 8 + get_url: + url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox-0.12.5-1.centos8.x86_64.rpm + dest: /tmp/wkhtmltox + when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '8' + +- name: download wkthmltox Debian 8 + get_url: + url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.jessie_{{ "amd64" if ansible_architecture == "x86_64" else "i386"}}.deb + dest: /tmp/wkhtmltox + checksum: '{{ 2583399a865d7604726da166ee7cec656b87ae0a6016e6bce7571dcd3045f98b if ansible_architecture == "x86_64" else 3a6969f3ed207a805092e05794644eb9e152aaa6518e9204c819fa318947a8a8 }}' + when: ansible_distribution == 'Debian' and ansible_distribution_major_version == '8' + +- name: download wkthmltox Debian 9 + get_url: + url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_{{ "amd64" if ansible_architecture == "x86_64" else "i386"}}.deb + dest: /tmp/wkhtmltox + checksum: '{{ 1140b0ab02aa6e17346af2f14ed0de807376de475ba90e1db3975f112fbd20bb if ansible_architecture == "x86_64" else 5b2d15e738ac479e7a8ca6fd765f406c3684a48091813520f87878278d6dd22a }}' + when: ansible_distribution == 'Debian' and ansible_distribution_major_version == '9' + +- name: download wkthmltox Debian 10 + get_url: + url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.buster_{{ "amd64" if ansible_architecture == "x86_64" else "i386"}}.deb + dest: /tmp/wkhtmltox + when: ansible_distribution == 'Debian' and ansible_distribution_major_version == '10' - name: copy to /usr/local/bin copy: src="/tmp/wkhtmltox/bin/wkhtmltopdf" dest="/usr/local/bin/wkhtmltopdf" From cf3c0b92658791fb7b25c94455dd86fb8695d393 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Wed, 26 Feb 2020 15:51:21 +0530 Subject: [PATCH 2/3] fix: checksum expression --- playbooks/roles/wkhtmltopdf/tasks/main.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/playbooks/roles/wkhtmltopdf/tasks/main.yml b/playbooks/roles/wkhtmltopdf/tasks/main.yml index d5fc71f8..089f6f5f 100644 --- a/playbooks/roles/wkhtmltopdf/tasks/main.yml +++ b/playbooks/roles/wkhtmltopdf/tasks/main.yml @@ -24,35 +24,35 @@ get_url: url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_{{ "amd64" if ansible_architecture == "x86_64" else "i386"}}.deb dest: /tmp/wkhtmltox - checksum: '{{ db48fa1a043309c4bfe8c8e0e38dc06c183f821599dd88d4e3cea47c5a5d4cd3 if ansible_architecture == "x86_64" else 1f5ac84c1cb25e385b49b94a04807d60bf73da217bc6c9fe2cbd1f0a61d33f63 }}' - when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version == '14' + checksum: "sha256:{{ 'db48fa1a043309c4bfe8c8e0e38dc06c183f821599dd88d4e3cea47c5a5d4cd3' if ansible_architecture == 'x86_64' else '1f5ac84c1cb25e385b49b94a04807d60bf73da217bc6c9fe2cbd1f0a61d33f63' }}" + when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version == '18' - name: download wkthmltox Ubuntu 16 get_url: url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.xenial_{{ "amd64" if ansible_architecture == "x86_64" else "i386"}}.deb dest: /tmp/wkhtmltox - checksum: '{{ df203cee4dc9b3efb8d0cd6fc25fa819883224f50c75b76bd9c856903711dc14 if ansible_architecture == "x86_64" else 27b6edafee099b87b2911cc68b780e79cffed3948bb5a074e8ea1cf8820da156 }}' + checksum: "sha256:{{ 'df203cee4dc9b3efb8d0cd6fc25fa819883224f50c75b76bd9c856903711dc14' if ansible_architecture == 'x86_64' else '27b6edafee099b87b2911cc68b780e79cffed3948bb5a074e8ea1cf8820da156' }}" when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version == '16' - name: download wkthmltox Ubuntu 14 get_url: url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.trusty_{{ "amd64" if ansible_architecture == "x86_64" else "i386"}}.deb dest: /tmp/wkhtmltox - checksum: '{{ 2a3d1fe80da0dbc69da56cf90a3d0ec2786d1b919be29527630d609fea4a6b7c if ansible_architecture == "x86_64" else 582e02881e4bc6be9aaa634da1fe8c02d3233fb57f6daab9efa137edb812dd3b }}' + checksum: "sha256:{{ '2a3d1fe80da0dbc69da56cf90a3d0ec2786d1b919be29527630d609fea4a6b7c' if ansible_architecture == 'x86_64' else '582e02881e4bc6be9aaa634da1fe8c02d3233fb57f6daab9efa137edb812dd3b' }}" when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version == '14' - name: download wkthmltox CentOS 6 get_url: url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox-0.12.5-1.centos6.{{ "x86_64" if ansible_architecture == "x86_64" else "i686"}}.rpm dest: /tmp/wkhtmltox - checksum: '{{ 17bff4966143d240a126b6cc414c6f79aa2106c0c97c772228e84d685221c25f if ansible_architecture == "x86_64" else c60e75fef5bfa1e79983919ffb47b40dcfbb49d121a510f11ca4b2a2603c00f1 }}' + checksum: "sha256:{{ '17bff4966143d240a126b6cc414c6f79aa2106c0c97c772228e84d685221c25f' if ansible_architecture == 'x86_64' else 'c60e75fef5bfa1e79983919ffb47b40dcfbb49d121a510f11ca4b2a2603c00f1' }}" when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '6' - name: download wkthmltox CentOS 7 get_url: url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox-0.12.5-1.centos7.{{ "x86_64" if ansible_architecture == "x86_64" else "i686"}}.rpm dest: /tmp/wkhtmltox - checksum: '{{ ac4f909b836fa1fc0188d19a1ab844910f91612e9ccefcb5298aa955a058ffe4 if ansible_architecture == "x86_64" else 1030279ac4b5b15dda04de2587b2a1942bde1c78aa1837dfec4ddcbea426721f }}' + checksum: "sha256:{{ 'ac4f909b836fa1fc0188d19a1ab844910f91612e9ccefcb5298aa955a058ffe4' if ansible_architecture == 'x86_64' else '1030279ac4b5b15dda04de2587b2a1942bde1c78aa1837dfec4ddcbea426721f' }}" when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7' - name: download wkthmltox CentOS 8 @@ -65,7 +65,7 @@ get_url: url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.jessie_{{ "amd64" if ansible_architecture == "x86_64" else "i386"}}.deb dest: /tmp/wkhtmltox - checksum: '{{ 2583399a865d7604726da166ee7cec656b87ae0a6016e6bce7571dcd3045f98b if ansible_architecture == "x86_64" else 3a6969f3ed207a805092e05794644eb9e152aaa6518e9204c819fa318947a8a8 }}' + checksum: "sha256:{{ '2583399a865d7604726da166ee7cec656b87ae0a6016e6bce7571dcd3045f98b' if ansible_architecture == 'x86_64' else '3a6969f3ed207a805092e05794644eb9e152aaa6518e9204c819fa318947a8a8' }}" when: ansible_distribution == 'Debian' and ansible_distribution_major_version == '8' - name: download wkthmltox Debian 9 From f3bcc42abe349194b6bd9bb6629f4b5453c750c5 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Thu, 27 Feb 2020 12:11:10 +0530 Subject: [PATCH 3/3] fix: add provision to install downloaded packages --- playbooks/roles/wkhtmltopdf/tasks/main.yml | 36 ++++++++++++---------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/playbooks/roles/wkhtmltopdf/tasks/main.yml b/playbooks/roles/wkhtmltopdf/tasks/main.yml index 089f6f5f..16a6e99d 100644 --- a/playbooks/roles/wkhtmltopdf/tasks/main.yml +++ b/playbooks/roles/wkhtmltopdf/tasks/main.yml @@ -23,71 +23,73 @@ - name: download wkthmltox Ubuntu 18 get_url: url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_{{ "amd64" if ansible_architecture == "x86_64" else "i386"}}.deb - dest: /tmp/wkhtmltox + dest: /tmp/wkhtmltox.deb checksum: "sha256:{{ 'db48fa1a043309c4bfe8c8e0e38dc06c183f821599dd88d4e3cea47c5a5d4cd3' if ansible_architecture == 'x86_64' else '1f5ac84c1cb25e385b49b94a04807d60bf73da217bc6c9fe2cbd1f0a61d33f63' }}" when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version == '18' - name: download wkthmltox Ubuntu 16 get_url: url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.xenial_{{ "amd64" if ansible_architecture == "x86_64" else "i386"}}.deb - dest: /tmp/wkhtmltox + dest: /tmp/wkhtmltox.deb checksum: "sha256:{{ 'df203cee4dc9b3efb8d0cd6fc25fa819883224f50c75b76bd9c856903711dc14' if ansible_architecture == 'x86_64' else '27b6edafee099b87b2911cc68b780e79cffed3948bb5a074e8ea1cf8820da156' }}" when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version == '16' - name: download wkthmltox Ubuntu 14 get_url: url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.trusty_{{ "amd64" if ansible_architecture == "x86_64" else "i386"}}.deb - dest: /tmp/wkhtmltox + dest: /tmp/wkhtmltox.deb checksum: "sha256:{{ '2a3d1fe80da0dbc69da56cf90a3d0ec2786d1b919be29527630d609fea4a6b7c' if ansible_architecture == 'x86_64' else '582e02881e4bc6be9aaa634da1fe8c02d3233fb57f6daab9efa137edb812dd3b' }}" when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version == '14' - name: download wkthmltox CentOS 6 get_url: url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox-0.12.5-1.centos6.{{ "x86_64" if ansible_architecture == "x86_64" else "i686"}}.rpm - dest: /tmp/wkhtmltox + dest: /tmp/wkhtmltox.rpm checksum: "sha256:{{ '17bff4966143d240a126b6cc414c6f79aa2106c0c97c772228e84d685221c25f' if ansible_architecture == 'x86_64' else 'c60e75fef5bfa1e79983919ffb47b40dcfbb49d121a510f11ca4b2a2603c00f1' }}" when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '6' - name: download wkthmltox CentOS 7 get_url: url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox-0.12.5-1.centos7.{{ "x86_64" if ansible_architecture == "x86_64" else "i686"}}.rpm - dest: /tmp/wkhtmltox + dest: /tmp/wkhtmltox.rpm checksum: "sha256:{{ 'ac4f909b836fa1fc0188d19a1ab844910f91612e9ccefcb5298aa955a058ffe4' if ansible_architecture == 'x86_64' else '1030279ac4b5b15dda04de2587b2a1942bde1c78aa1837dfec4ddcbea426721f' }}" when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7' - name: download wkthmltox CentOS 8 get_url: url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox-0.12.5-1.centos8.x86_64.rpm - dest: /tmp/wkhtmltox + dest: /tmp/wkhtmltox.rpm when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '8' - name: download wkthmltox Debian 8 get_url: url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.jessie_{{ "amd64" if ansible_architecture == "x86_64" else "i386"}}.deb - dest: /tmp/wkhtmltox + dest: /tmp/wkhtmltox.deb checksum: "sha256:{{ '2583399a865d7604726da166ee7cec656b87ae0a6016e6bce7571dcd3045f98b' if ansible_architecture == 'x86_64' else '3a6969f3ed207a805092e05794644eb9e152aaa6518e9204c819fa318947a8a8' }}" when: ansible_distribution == 'Debian' and ansible_distribution_major_version == '8' - name: download wkthmltox Debian 9 get_url: url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_{{ "amd64" if ansible_architecture == "x86_64" else "i386"}}.deb - dest: /tmp/wkhtmltox + dest: /tmp/wkhtmltox.deb checksum: '{{ 1140b0ab02aa6e17346af2f14ed0de807376de475ba90e1db3975f112fbd20bb if ansible_architecture == "x86_64" else 5b2d15e738ac479e7a8ca6fd765f406c3684a48091813520f87878278d6dd22a }}' when: ansible_distribution == 'Debian' and ansible_distribution_major_version == '9' - name: download wkthmltox Debian 10 get_url: url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.buster_{{ "amd64" if ansible_architecture == "x86_64" else "i386"}}.deb - dest: /tmp/wkhtmltox + dest: /tmp/wkhtmltox.deb when: ansible_distribution == 'Debian' and ansible_distribution_major_version == '10' -- name: copy to /usr/local/bin - copy: src="/tmp/wkhtmltox/bin/wkhtmltopdf" dest="/usr/local/bin/wkhtmltopdf" - become: true - become_user: root +- name: Install wkhtmltox rpm + yum: + name: /tmp/wkhtmltox.rpm + state: present + when: ansible_os_family == 'RedHat' -- name: make wkhtmltopdf executable - file: path=/usr/local/bin/wkhtmltopdf mode="o+x" - become: true - become_user: root +- name: Install wkhtmltox deb + apt: + deb: /tmp/wkhtmltox.deb + state: present + when: ansible_os_family == 'Debian' ... \ No newline at end of file