-
Notifications
You must be signed in to change notification settings - Fork 6
/
wkhtmltopdf.yml
44 lines (37 loc) · 1.31 KB
/
wkhtmltopdf.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
- name: install required libraries for wkhtmltopdf
apt: pkg=libxrender1,libxext6
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: wkhtmltopdf file exist check
stat:
path: "{{root_dir}}/bin/wkhtmltopdf"
register: wkhtmltopdf_stat
- name: Download wkhtmltopdf
get_url:
url: http://download.gna.org/wkhtmltopdf/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
dest: /tmp
when: not wkhtmltopdf_stat.stat.exists
- name: Extract wkhtmltopdf
unarchive:
src: /tmp/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
dest: /tmp
copy: no
when: not wkhtmltopdf_stat.stat.exists
- name: Create bin directory
file: name={{ root_dir }}/bin state=directory owner={{ appserver_user }} group={{ appserver_user }}
when: not wkhtmltopdf_stat.stat.exists
- name: Copy wkhtmltopdf to correct location
copy:
src: /tmp/wkhtmltox/bin/wkhtmltopdf
dest: "{{root_dir}}/bin/wkhtmltopdf"
remote_src: True
mode: "a+x"
when: not wkhtmltopdf_stat.stat.exists
- name: Delete temporary files
file:
path: "{{ item.path }}"
state: absent
with_items:
- {path: "/tmp/wkhtmltox"}
- {path: "/tmp/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz"}
- name: Generate envdir entry
copy: dest={{ project_dir }}/envdir/WKHTMLTOPDF content={{root_dir}}/bin/wkhtmltopdf