-
Notifications
You must be signed in to change notification settings - Fork 1
/
pepperflash.yml
69 lines (63 loc) · 1.79 KB
/
pepperflash.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
- name: PepperFlash
hosts: arch
vars:
version: 26.0.0.151
flashplayer: https://fpdownload.macromedia.com/pub/flashplayer
latestxml: '{{flashplayer}}/masterversion/masterversion.xml'
url: '{{flashplayer}}/pdc/{{parsedversion}}/{{basename}}'
parsedversion: '{{findversion.stdout}}'
basename: 'flash_player_ppapi_linux.x86_64.tar.gz'
xpath: 'string(/version/release/PPAPI_linuxchrome/@version)'
cache: '{{gitbuild}}/{{basename}}'
latest: '{{cache}}.latest'
root: /opt/flash
prefix: '{{root}}/{{version}}'
current: '{{root}}/current'
library: libpepflashplayer.so
manifest: manifest.json
update: false
tasks:
- name: Fetch latest Flash version
shell: |
curl -s {{latestxml}} |
xmllint --xpath '{{xpath}}' - |
tr , . |
tee "{{latest}}"
args:
creates: '{{omit if update else latest}}'
# I'm not `using 'curl'`... I'm using `curl | xmllint | tr | tee`:
warn: no
register: fetchlatest
- name: Parse latest version
shell: |
if {{update|lower}}
then cat {{latest}}
else echo {{version}}
fi
changed_when: false
check_mode: no
register: findversion
- name: Download latest Flash
get_url:
url: '{{url}}'
dest: '{{cache}}'
- name: Install directory
file:
state: directory
dest: '{{prefix}}'
mode: 0755
- name: Install latest Flash
unarchive:
src: '{{cache}}'
remote_src: true
dest: '{{prefix}}'
extra_opts:
- '{{library}}'
- '{{manifest}}'
notify: update current link
handlers:
- name: update current link
file:
state: link
dest: '{{current}}'
src: '{{parsedversion}}'