blob: 6914ffa02731adc547cef732e0d2e34fa81991df [file] [log] [blame]
Jessica Wagantall564913e2018-03-19 13:41:33 -07001---
2- import_playbook: ../common-packer/provision/docker.yaml
3
4- hosts: all
5 become_user: root
6 become_method: sudo
Jessica Wagantall0cd37002018-03-27 16:14:46 -07007 vars:
Jessica Wagantall5db567b2018-08-16 20:26:42 -07008 apt_file: /etc/apt/sources.list.d/google-chrome.list
Jessica Wagantall0cd37002018-03-27 16:14:46 -07009 docker_compose_version: 1.17.1
10 glide_checksum: sha256:c403933503ea40308ecfadcff581ff0dc3190c57958808bb9eed016f13f6f32c
11 glide_version: v0.13.1
Jessica Wagantall0cd37002018-03-27 16:14:46 -070012 golang_version: 1.9.1
Jessica Wagantallca8c5242021-06-21 19:55:40 -070013 npm_version: "6.14.13"
Jessica Wagantall564913e2018-03-19 13:41:33 -070014
Jessica Wagantall0cd37002018-03-27 16:14:46 -070015 tasks:
Martin Klozik7b684212019-03-27 13:55:59 +010016 - name: "Checking for x86_64"
17 set_fact:
18 host_arch: "amd64"
19 golang_checksum: sha256:07d81c6b6b4c2dcf1b5ef7c27aaebd3691cdb40548500941f92b221147c5d9c7
20 when: "'x86_64' in ansible_architecture"
21
22 - name: "Checking for aarch64"
23 set_fact:
24 host_arch: "arm64"
25 golang_checksum: sha256:d31ecae36efea5197af271ccce86ccc2baf10d2e04f20d0fb75556ecf0614dad
26 when: "'aarch64' in ansible_architecture"
27
Jessica Wagantall0cd37002018-03-27 16:14:46 -070028 - name: 'Install Docker Compose {{docker_compose_version}}'
Jessica Wagantall096164e2018-08-15 10:07:47 -070029 command: curl -o /usr/local/bin/docker-compose -L "https://github.com/docker/compose/releases/download/{{docker_compose_version}}/docker-compose-Linux-x86_64"
Jessica Wagantall564913e2018-03-19 13:41:33 -070030 become: true
Jessica Wagantall0cd37002018-03-27 16:14:46 -070031
Jessica Wagantall5826a6a2018-08-11 23:38:07 -070032 - file:
33 path: /usr/local/bin/docker-compose
34 mode: "+x"
Jessica Wagantalldbadc482018-08-13 14:13:57 -070035 become: true
Jessica Wagantall5826a6a2018-08-11 23:38:07 -070036
Jessica Wagantall0cd37002018-03-27 16:14:46 -070037 - name: 'Install GoLang {{golang_version}}'
38 block:
Martin Klozik7b684212019-03-27 13:55:59 +010039 - name: 'Fetch golang {{golang_version}} to /tmp/go{{golang_version}}.linux-{{host_arch}}.tar.gz'
Jessica Wagantall0cd37002018-03-27 16:14:46 -070040 get_url:
Martin Klozik7b684212019-03-27 13:55:59 +010041 url: 'https://storage.googleapis.com/golang/go{{golang_version}}.linux-{{host_arch}}.tar.gz'
42 dest: '/tmp/go{{golang_version}}.linux-{{host_arch}}.tar.gz'
Jessica Wagantall0cd37002018-03-27 16:14:46 -070043 checksum: '{{golang_checksum}}'
44 - name: 'Install golang {{golang_version}} to /usr/local'
45 unarchive:
Martin Klozik7b684212019-03-27 13:55:59 +010046 src: '/tmp/go{{golang_version}}.linux-{{host_arch}}.tar.gz'
Jessica Wagantall0cd37002018-03-27 16:14:46 -070047 dest: /usr/local
48 remote_src: true
49 become: true
Jessica Wagantallb4acd422018-09-05 13:38:55 -070050 - name: Create symbolic link to go bin
51 file:
52 src: "/usr/local/go/bin/go"
53 dest: "/usr/bin/go"
54 state: link
Jessica Wagantall0cd37002018-03-27 16:14:46 -070055 become: true
Jessica Wagantall19ce2f52018-08-08 12:25:08 -070056
57 - name: Install libxml2-utils
58 apt:
59 name: libxml2-utils
60 state: present
61 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -070062 when: ansible_distribution == 'Ubuntu'
Jessica Wagantall7f93ce02018-08-09 19:41:49 -070063
Jessica Wagantall0b9a6b22020-02-24 13:47:24 -080064 - name: Install python-tox and deps
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -070065 pip:
Jessica Wagantall0b9a6b22020-02-24 13:47:24 -080066 name:
67 - tox
68 - tox-pyenv
69 - virtualenv
70 - more-itertools~=5.0.0
71 - zipp==1.0.0
Jessica Wagantall7f93ce02018-08-09 19:41:49 -070072 state: present
73 become: true
Jessica Wagantall42bf8272018-08-09 22:02:42 -070074
75 - apt_repository:
efiacor27f55b72019-11-27 20:02:52 +000076 repo: ppa:deadsnakes/ppa
77 state: present
78 become: true
79 when: ansible_distribution == 'Ubuntu'
80
Jessica Wagantall42bf8272018-08-09 22:02:42 -070081 - name: Update and upgrade apt packages
82 apt:
Bengt Thuree4e2a3e82020-03-26 12:22:18 +110083 upgrade: 'yes'
Jessica Wagantall42bf8272018-08-09 22:02:42 -070084 update_cache: yes
85 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -070086 when: ansible_distribution == 'Ubuntu'
Jessica Wagantall42bf8272018-08-09 22:02:42 -070087
88 - name: Install Python 3.6 and packages
89 apt:
90 name:
91 - python3.6
92 - python3.6-dev
Milin3fabeee2019-09-05 14:52:31 -050093 - python3.6-tk
Jessica Wagantall42bf8272018-08-09 22:02:42 -070094 - libssl-dev
95 - libmysqlclient-dev
96 - gcc
Jessica Wagantall175d5ef2020-02-20 10:23:58 -080097 - python3-venv
Jessica Wagantall42bf8272018-08-09 22:02:42 -070098 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -070099 when: ansible_distribution == 'Ubuntu'
Jessica Wagantall3fc37fe2018-08-10 00:16:16 -0700100
efiacor27f55b72019-11-27 20:02:52 +0000101 - name: Install Python 3.7
102 apt:
103 name:
104 - python3.7
105 - python3.7-dev
106 - python3.7-tk
107 become: true
108 when: ansible_distribution == 'Ubuntu'
109
vv770d4f9ba442020-07-17 20:46:45 +0000110 - name: Install Python 3.8
111 apt:
112 name:
113 - python3.8
114 - python3.8-dev
115 - python3.8-tk
116 become: true
117 when: ansible_distribution == 'Ubuntu'
118
Michal Jagiello9f7857e2021-01-22 22:24:57 +0000119 - name: Install Python 3.9
120 apt:
121 name:
122 - python3.9
123 - python3.9-dev
124 - python3.9-tk
Bengt Thuree14473ea2021-03-16 13:29:06 +1100125 - python3.9-distutils
Michal Jagiello9f7857e2021-01-22 22:24:57 +0000126 become: true
127 when: ansible_distribution == 'Ubuntu'
128
Jessica Wagantalldbba0aa2020-03-16 09:28:18 -0700129 - name: Install nodejs-dev libssl1.0-dev dep
130 apt:
131 name:
132 - libssl1.0-dev
133 update_cache: yes
134 state: fixed
135 become: true
136 when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '18.04'
137
Jessica Wagantalld919c8c2020-03-16 11:49:37 -0700138 - name: Install nodejs-dev dep for npm
139 apt:
140 name:
141 - nodejs-dev
142 update_cache: yes
143 state: fixed
144 become: true
145 when: ansible_distribution == 'Ubuntu'
146
Jessica Wagantalldbba0aa2020-03-16 09:28:18 -0700147 - name: Install supporting packages
Jessica Wagantall3fc37fe2018-08-10 00:16:16 -0700148 apt:
149 name:
150 - unzip
151 - xz-utils
152 - libxml-xpath-perl
153 - wget
154 - make
Jessica Wagantall3fc37fe2018-08-10 00:16:16 -0700155 - sshuttle
156 - netcat
157 - libssl-dev
158 - libffi-dev
Jessica Wagantall3fc37fe2018-08-10 00:16:16 -0700159 - xmlstarlet
160 - xvfb
161 - crudini
162 - maven
163 - python-ncclient
Jessica Wagantall25201972020-02-19 12:00:04 -0800164 - xmlstarlet
165 - xvfb
166 - crudini
167 - maven
168 - python-ncclient
Jessica Wagantall25201972020-02-19 12:00:04 -0800169 update_cache: yes
Jessica Wagantall307720b2020-03-12 20:56:49 -0700170 state: fixed
171 become: true
172 when: ansible_distribution == 'Ubuntu'
173
Jessica Wagantalldbba0aa2020-03-16 09:28:18 -0700174 - name: Install npm and addon packages
Jessica Wagantall307720b2020-03-12 20:56:49 -0700175 apt:
176 name:
Jessica Wagantalldbba0aa2020-03-16 09:28:18 -0700177 - nodejs
178 - npm
Jessica Wagantall307720b2020-03-12 20:56:49 -0700179 - node-gyp
180 update_cache: yes
181 state: fixed
Jessica Wagantall3fc37fe2018-08-10 00:16:16 -0700182 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700183 when: ansible_distribution == 'Ubuntu'
Jessica Wagantall5db567b2018-08-16 20:26:42 -0700184
Jessica Wagantallca8c5242021-06-21 19:55:40 -0700185 - name: npm self-update
186 command: npm install npm@{{ npm_version }} -g
187 become: true
188
189 - name: npm install n module
190 command: npm install n -g
191 become: true
192
193 - name: Upgrade latest stable node version
194 command: n stable | PATH="$PATH"
195 become: true
196
Jessica Wagantall5db567b2018-08-16 20:26:42 -0700197 - name: Add Google Chrome key
198 apt_key:
199 url: https://dl-ssl.google.com/linux/linux_signing_key.pub
200 state: present
201 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700202 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantall5db567b2018-08-16 20:26:42 -0700203
204 - name: Add Google Chrome repo
205 copy: content="deb http://dl.google.com/linux/chrome/deb/ stable main" dest={{apt_file}} owner=root group=root mode=644
206 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700207 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantall5db567b2018-08-16 20:26:42 -0700208
209 - name: Update apt cache
210 apt: update_cache=yes
211 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700212 when: ansible_distribution == 'Ubuntu'
Jessica Wagantall5db567b2018-08-16 20:26:42 -0700213
214 - name: Install Google Chrome
215 apt:
216 name: google-chrome-stable
217 state: present
218 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700219 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantallba4a03d2018-08-21 12:11:32 -0700220
Jessica Wagantall6e96b2e2018-08-21 14:38:37 -0700221 - name: Install Erlang dependency packages
222 apt:
223 name:
224 - libwxgtk3.0-0v5
225 - libsctp1
226 - libwxbase3.0-0v5
227 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700228 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantall6e96b2e2018-08-21 14:38:37 -0700229
230 - name: Install Erlang
231 apt:
Vanessa Rene Valderrama6eea1692019-06-28 14:39:51 -0500232 deb: https://packages.erlang-solutions.com/erlang/debian/pool/esl-erlang_19.3.6-1~ubuntu~trusty_amd64.deb
Jessica Wagantall6e96b2e2018-08-21 14:38:37 -0700233 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700234 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantall6e96b2e2018-08-21 14:38:37 -0700235
Jessica Wagantallba4a03d2018-08-21 12:11:32 -0700236 - name: Clone rebar3
237 git:
238 repo: 'https://github.com/erlang/rebar3.git'
239 dest: /tmp/rebar3
Jessica Wagantall497dd982021-06-28 18:08:06 -0700240 version: v3.13
241 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
242
243 - name: Bootstrap rebar3
244 command: ./bootstrap
245 args:
246 chdir: /tmp/rebar3
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700247 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantallba4a03d2018-08-21 12:11:32 -0700248
Jessica Wagantall79c77662018-08-21 14:16:28 -0700249 - name: Install rebar3 to bin
250 copy:
251 src: /tmp/rebar3/rebar3
252 dest: /usr/bin/rebar3
Jessica Wagantallb4cf59a2018-08-24 12:17:49 -0700253 mode: 0755
Jessica Wagantall79c77662018-08-21 14:16:28 -0700254 remote_src: true
Jessica Wagantall58744aa2018-08-21 17:48:03 -0700255 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700256 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantallba4a03d2018-08-21 12:11:32 -0700257
258 - name: Remove unused rebar3 source
259 file:
260 path: /tmp/rebar3
261 state: absent
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700262 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantall49f835a2018-08-23 15:08:54 -0700263
264 - name: Download geckodriver
265 unarchive:
266 src: https://github.com/mozilla/geckodriver/releases/download/v0.18.0/geckodriver-v0.18.0-linux64.tar.gz
267 dest: /usr/bin
Jessica Wagantallb4cf59a2018-08-24 12:17:49 -0700268 mode: 0755
Jessica Wagantall49f835a2018-08-23 15:08:54 -0700269 remote_src: yes
270 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700271 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantallc944ef02018-08-30 17:53:11 -0700272
273 - name: Download Firefox version 55.0.3
274 unarchive:
275 src: https://download-installer.cdn.mozilla.net/pub/firefox/releases/55.0.3/linux-x86_64/en-US/firefox-55.0.3.tar.bz2
Jessica Wagantallbbdb4d62018-09-24 18:21:48 -0700276 dest: /opt
Jessica Wagantallc944ef02018-08-30 17:53:11 -0700277 mode: 0755
278 remote_src: yes
279 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700280 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantallc944ef02018-08-30 17:53:11 -0700281
282 - name: Create symbolic link to firefox bin
283 file:
Jessica Wagantallbbdb4d62018-09-24 18:21:48 -0700284 src: "/opt/firefox/firefox"
Jessica Wagantallc944ef02018-08-30 17:53:11 -0700285 dest: "/usr/bin/firefox"
286 state: link
287 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700288 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Vanessa Rene Valderramadc363272019-06-27 15:37:37 -0500289
290 - name: Install jinja2
291 pip:
292 name: jinja2
293 state: present
294 become: true
295 when: ansible_architecture == 'x86_64'