Install Firefox 55.0.3
[ci-management.git] / packer / provision / local-docker.yaml
1 ---
2 - import_playbook: ../common-packer/provision/docker.yaml
3
4 - hosts: all
5   become_user: root
6   become_method: sudo
7   vars:
8     apt_file: /etc/apt/sources.list.d/google-chrome.list
9     docker_compose_version: 1.17.1
10     glide_checksum: sha256:c403933503ea40308ecfadcff581ff0dc3190c57958808bb9eed016f13f6f32c
11     glide_version: v0.13.1
12     golang_checksum: sha256:07d81c6b6b4c2dcf1b5ef7c27aaebd3691cdb40548500941f92b221147c5d9c7
13     golang_version: 1.9.1
14
15   tasks:
16     - name: 'Install Docker Compose {{docker_compose_version}}'
17       command: curl -o /usr/local/bin/docker-compose -L "https://github.com/docker/compose/releases/download/{{docker_compose_version}}/docker-compose-Linux-x86_64"
18       become: true
19
20     - file:
21         path: /usr/local/bin/docker-compose
22         mode: "+x"
23       become: true
24
25     - name: 'Install GoLang {{golang_version}}'
26       block:
27         - name: 'Fetch golang {{golang_version}} to /tmp/go{{golang_version}}.linux-amd64.tar.gz'
28           get_url:
29             url: 'https://storage.googleapis.com/golang/go{{golang_version}}.linux-amd64.tar.gz'
30             dest: '/tmp/go{{golang_version}}.linux-amd64.tar.gz'
31             checksum: '{{golang_checksum}}'
32         - name: 'Install golang {{golang_version}} to /usr/local'
33           unarchive:
34             src: '/tmp/go{{golang_version}}.linux-amd64.tar.gz'
35             dest: /usr/local
36             remote_src: true
37           become: true
38         - name: 'Add golang to PATH'
39           command: 'echo "export PATH=$PATH:/usr/local/go/bin" >> /etc/profile'
40           become: true
41
42     - name: Install libxml2-utils
43       apt:
44         name: libxml2-utils
45         state: present
46       become: true
47
48     - name: Install python-tox
49       apt:
50         name: python-tox
51         state: present
52       become: true
53
54     - apt_repository:
55         repo: ppa:jonathonf/python-3.6
56         state: present
57       become: true
58
59     - name: Update and upgrade apt packages
60       apt:
61         upgrade: yes
62         update_cache: yes
63       become: true
64
65     - name: Install Python 3.6 and packages
66       apt:
67         name:
68           - python3.6
69           - python3.6-dev
70           - libssl-dev
71           - libmysqlclient-dev
72           - gcc
73       become: true
74
75     - name: Install base packages
76       apt:
77         name:
78           - unzip
79           - xz-utils
80           - libxml-xpath-perl
81           - wget
82           - make
83           - npm
84           - sshuttle
85           - netcat
86           - libssl-dev
87           - libffi-dev
88       become: true
89
90     - name: Install autorelease support packages
91       apt:
92         name:
93           - xmlstarlet
94           - xvfb
95           - crudini
96           - maven
97           - python-ncclient
98       become: true
99
100     - name: Add Google Chrome key
101       apt_key:
102         url: https://dl-ssl.google.com/linux/linux_signing_key.pub
103         state: present
104       become: true
105
106     - name: Add Google Chrome repo
107       copy: content="deb http://dl.google.com/linux/chrome/deb/ stable main" dest={{apt_file}} owner=root group=root mode=644
108       become: true
109
110     - name: Update apt cache
111       apt: update_cache=yes
112       become: true
113
114     - name: Install Google Chrome
115       apt:
116         name: google-chrome-stable
117         state: present
118       become: true
119
120     - name: Install Erlang dependency packages
121       apt:
122         name:
123           - libwxgtk3.0-0v5
124           - libsctp1
125           - libwxbase3.0-0v5
126       become: true
127
128     - name: Install Erlang
129       apt:
130         deb: https://packages.erlang-solutions.com/erlang/esl-erlang/FLAVOUR_1_general/esl-erlang_19.3.6-1~ubuntu~trusty_amd64.deb
131       install_recommends: yes
132       become: true
133
134     - name: Clone rebar3
135       git:
136         repo: 'https://github.com/erlang/rebar3.git'
137         dest: /tmp/rebar3
138
139     - name: Bootstrap rebar3
140       command: ./bootstrap
141       args:
142         chdir: /tmp/rebar3
143
144     - name: Install rebar3 to bin
145       copy:
146         src: /tmp/rebar3/rebar3
147         dest: /usr/bin/rebar3
148         mode: 0755
149         remote_src: true
150       become: true
151
152     - name: Remove unused rebar3 source
153       file:
154         path: /tmp/rebar3
155         state: absent
156
157     - name: Download geckodriver
158       unarchive:
159         src: https://github.com/mozilla/geckodriver/releases/download/v0.18.0/geckodriver-v0.18.0-linux64.tar.gz
160         dest: /usr/bin
161         mode: 0755
162         remote_src: yes
163       become: true
164
165     - name: Download Firefox version 55.0.3
166       unarchive:
167         src: https://download-installer.cdn.mozilla.net/pub/firefox/releases/55.0.3/linux-x86_64/en-US/firefox-55.0.3.tar.bz2
168         dest: /tmp
169         mode: 0755
170         remote_src: yes
171       become: true
172
173     - name: Create symbolic link to firefox bin
174       file:
175         src: "/usr/bin/firefox-bin/firefox/firefox"
176         dest: "/usr/bin/firefox"
177         state: link
178       become: true