blob: b7e1c5525d77b6e63204382e19ed888fbee8629c [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
Eric Ball8d6ce3f2022-07-06 13:45:47 -07009 docker_compose_version: 1.29.2
Jessica Wagantall0cd37002018-03-27 16:14:46 -070010 glide_checksum: sha256:c403933503ea40308ecfadcff581ff0dc3190c57958808bb9eed016f13f6f32c
11 glide_version: v0.13.1
Jessica Wagantall0cd37002018-03-27 16:14:46 -070012 golang_version: 1.9.1
Jessica Wagantall9b414142023-04-17 18:43:01 -070013 npm_version: "9.6.4"
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
Andrew Grimberga6b750c2023-05-03 08:47:44 -070028 - name: "Install Docker Compose {{docker_compose_version}}"
29 # yamllint disable-line rule:line-length
Jessica Wagantall096164e2018-08-15 10:07:47 -070030 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 -070031 become: true
Jessica Wagantall0cd37002018-03-27 16:14:46 -070032
Jessica Wagantall5826a6a2018-08-11 23:38:07 -070033 - file:
34 path: /usr/local/bin/docker-compose
35 mode: "+x"
Jessica Wagantalldbadc482018-08-13 14:13:57 -070036 become: true
Jessica Wagantall5826a6a2018-08-11 23:38:07 -070037
Andrew Grimberga6b750c2023-05-03 08:47:44 -070038 - name: "Install GoLang {{golang_version}}"
Jessica Wagantall0cd37002018-03-27 16:14:46 -070039 block:
Andrew Grimberga6b750c2023-05-03 08:47:44 -070040 - name: "Fetch golang {{golang_version}} to /tmp/go{{golang_version}}.linux-{{host_arch}}.tar.gz"
Jessica Wagantall0cd37002018-03-27 16:14:46 -070041 get_url:
Andrew Grimberga6b750c2023-05-03 08:47:44 -070042 url: "https://storage.googleapis.com/golang/go{{golang_version}}.linux-{{host_arch}}.tar.gz"
43 dest: "/tmp/go{{golang_version}}.linux-{{host_arch}}.tar.gz"
44 checksum: "{{golang_checksum}}"
45 - name: "Install golang {{golang_version}} to /usr/local"
Jessica Wagantall0cd37002018-03-27 16:14:46 -070046 unarchive:
Andrew Grimberga6b750c2023-05-03 08:47:44 -070047 src: "/tmp/go{{golang_version}}.linux-{{host_arch}}.tar.gz"
Jessica Wagantall0cd37002018-03-27 16:14:46 -070048 dest: /usr/local
49 remote_src: true
50 become: true
Jessica Wagantallb4acd422018-09-05 13:38:55 -070051 - name: Create symbolic link to go bin
52 file:
53 src: "/usr/local/go/bin/go"
54 dest: "/usr/bin/go"
55 state: link
Jessica Wagantall0cd37002018-03-27 16:14:46 -070056 become: true
Jessica Wagantall19ce2f52018-08-08 12:25:08 -070057
58 - name: Install libxml2-utils
59 apt:
60 name: libxml2-utils
61 state: present
62 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -070063 when: ansible_distribution == 'Ubuntu'
Jessica Wagantall7f93ce02018-08-09 19:41:49 -070064
Jessica Wagantall42bf8272018-08-09 22:02:42 -070065 - apt_repository:
efiacor27f55b72019-11-27 20:02:52 +000066 repo: ppa:deadsnakes/ppa
67 state: present
68 become: true
69 when: ansible_distribution == 'Ubuntu'
70
Jessica Wagantall42bf8272018-08-09 22:02:42 -070071 - name: Update and upgrade apt packages
72 apt:
Andrew Grimberga6b750c2023-05-03 08:47:44 -070073 upgrade: "yes"
74 update_cache: true
Jessica Wagantall42bf8272018-08-09 22:02:42 -070075 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -070076 when: ansible_distribution == 'Ubuntu'
Jessica Wagantall42bf8272018-08-09 22:02:42 -070077
78 - name: Install Python 3.6 and packages
79 apt:
80 name:
81 - python3.6
82 - python3.6-dev
Milin3fabeee2019-09-05 14:52:31 -050083 - python3.6-tk
Jessica Wagantall42bf8272018-08-09 22:02:42 -070084 - libssl-dev
85 - libmysqlclient-dev
86 - gcc
Jessica Wagantall175d5ef2020-02-20 10:23:58 -080087 - python3-venv
Jessica Wagantall42bf8272018-08-09 22:02:42 -070088 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -070089 when: ansible_distribution == 'Ubuntu'
Jessica Wagantall3fc37fe2018-08-10 00:16:16 -070090
efiacor27f55b72019-11-27 20:02:52 +000091 - name: Install Python 3.7
92 apt:
93 name:
94 - python3.7
95 - python3.7-dev
96 - python3.7-tk
97 become: true
98 when: ansible_distribution == 'Ubuntu'
99
vv770d4f9ba442020-07-17 20:46:45 +0000100 - name: Install Python 3.8
101 apt:
102 name:
103 - python3.8
104 - python3.8-dev
105 - python3.8-tk
106 become: true
107 when: ansible_distribution == 'Ubuntu'
108
Michal Jagiello9f7857e2021-01-22 22:24:57 +0000109 - name: Install Python 3.9
110 apt:
111 name:
112 - python3.9
113 - python3.9-dev
114 - python3.9-tk
Bengt Thuree14473ea2021-03-16 13:29:06 +1100115 - python3.9-distutils
Michal Jagiello9f7857e2021-01-22 22:24:57 +0000116 become: true
117 when: ansible_distribution == 'Ubuntu'
118
Jessica Wagantallaea673b2022-09-06 12:28:28 -0700119 - name: Install supporting packages (Ubuntu 18.04)
Jessica Wagantall3fc37fe2018-08-10 00:16:16 -0700120 apt:
121 name:
122 - unzip
123 - xz-utils
124 - libxml-xpath-perl
125 - wget
126 - make
Jessica Wagantall3fc37fe2018-08-10 00:16:16 -0700127 - sshuttle
128 - netcat
129 - libssl-dev
130 - libffi-dev
Jessica Wagantall3fc37fe2018-08-10 00:16:16 -0700131 - xmlstarlet
132 - xvfb
133 - crudini
134 - maven
135 - python-ncclient
Andrew Grimberga6b750c2023-05-03 08:47:44 -0700136 update_cache: true
Jessica Wagantallaea673b2022-09-06 12:28:28 -0700137 state: fixed
138 become: true
139 when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '18.04'
140
141 - name: Install supporting packages (Ubuntu 20.04)
142 apt:
143 name:
144 - unzip
145 - xz-utils
146 - libxml-xpath-perl
147 - wget
148 - make
149 - sshuttle
150 - netcat
151 - libssl-dev
152 - libffi-dev
Jessica Wagantall25201972020-02-19 12:00:04 -0800153 - xmlstarlet
154 - xvfb
155 - crudini
156 - maven
Bengt Thuree1610dcb2022-09-08 19:26:17 +1000157 - python3-ncclient
Andrew Grimberga6b750c2023-05-03 08:47:44 -0700158 update_cache: true
Jessica Wagantall307720b2020-03-12 20:56:49 -0700159 state: fixed
160 become: true
Jessica Wagantallaea673b2022-09-06 12:28:28 -0700161 when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '20.04'
Jessica Wagantall307720b2020-03-12 20:56:49 -0700162
Jessica Wagantallf7d01362023-04-12 16:11:10 -0700163 - name: Install nodejs
Jessica Wagantall47761bf2023-04-12 11:43:26 -0700164 block:
Jessica Wagantallf7d01362023-04-12 16:11:10 -0700165 - name: install nodejs prerequisites
166 apt:
167 name:
168 - apt-transport-https
169 - g++
Andrew Grimberga6b750c2023-05-03 08:47:44 -0700170 update_cache: true
Jessica Wagantallf7d01362023-04-12 16:11:10 -0700171 state: present
172 become: true
173 - name: add nodejs apt key
174 apt_key:
175 url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
176 state: present
Jessica Wagantallb8760a02023-04-13 18:24:09 -0700177 become: true
Jessica Wagantallf7d01362023-04-12 16:11:10 -0700178 - name: add nodejs repository
179 apt_repository:
180 repo: deb https://deb.nodesource.com/node_19.x {{ ansible_distribution_release }} main
Jessica Wagantalle554b572023-04-14 09:54:50 -0700181 state: present
Andrew Grimberga6b750c2023-05-03 08:47:44 -0700182 update_cache: true
Jessica Wagantallb8760a02023-04-13 18:24:09 -0700183 become: true
Jessica Wagantallf7d01362023-04-12 16:11:10 -0700184 - name: install nodejs
185 apt:
186 name:
187 - nodejs
188 state: present
189 become: true
Jessica Wagantall306347b2023-04-17 09:23:15 -0700190 when: ansible_distribution == 'Ubuntu'
Jessica Wagantallf7d01362023-04-12 16:11:10 -0700191
192 - name: Check nodejs and npm versions
193 block:
Andrew Grimberga6b750c2023-05-03 08:47:44 -0700194 - name: "Check nodejs version"
Jessica Wagantall47761bf2023-04-12 11:43:26 -0700195 command: node --version
Andrew Grimberga6b750c2023-05-03 08:47:44 -0700196 - name: "Check npm version"
Jessica Wagantall47761bf2023-04-12 11:43:26 -0700197 command: npm --version
198 when: ansible_distribution == 'Ubuntu'
199
200 - name: Install npm build tools
201 apt:
202 name: build-essential
Andrew Grimberga6b750c2023-05-03 08:47:44 -0700203 update_cache: true
Jessica Wagantall47761bf2023-04-12 11:43:26 -0700204 state: fixed
205 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700206 when: ansible_distribution == 'Ubuntu'
Jessica Wagantall5db567b2018-08-16 20:26:42 -0700207
Jessica Wagantallca8c5242021-06-21 19:55:40 -0700208 - name: npm self-update
209 command: npm install npm@{{ npm_version }} -g
210 become: true
Jessica Wagantall1c371f02022-09-06 18:40:47 -0700211 when: ansible_distribution == 'Ubuntu'
Jessica Wagantallca8c5242021-06-21 19:55:40 -0700212
213 - name: npm install n module
214 command: npm install n -g
215 become: true
Jessica Wagantall1c371f02022-09-06 18:40:47 -0700216 when: ansible_distribution == 'Ubuntu'
Jessica Wagantallca8c5242021-06-21 19:55:40 -0700217
218 - name: Upgrade latest stable node version
219 command: n stable | PATH="$PATH"
220 become: true
Jessica Wagantall1c371f02022-09-06 18:40:47 -0700221 when: ansible_distribution == 'Ubuntu'
Jessica Wagantallca8c5242021-06-21 19:55:40 -0700222
Jessica Wagantall5db567b2018-08-16 20:26:42 -0700223 - name: Add Google Chrome key
224 apt_key:
225 url: https://dl-ssl.google.com/linux/linux_signing_key.pub
226 state: present
227 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700228 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantall5db567b2018-08-16 20:26:42 -0700229
230 - name: Add Google Chrome repo
Andrew Grimberga6b750c2023-05-03 08:47:44 -0700231 # yamllint disable-line rule:line-length
Jessica Wagantall5db567b2018-08-16 20:26:42 -0700232 copy: content="deb http://dl.google.com/linux/chrome/deb/ stable main" dest={{apt_file}} owner=root group=root mode=644
233 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700234 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantall5db567b2018-08-16 20:26:42 -0700235
236 - name: Update apt cache
237 apt: update_cache=yes
238 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700239 when: ansible_distribution == 'Ubuntu'
Jessica Wagantall5db567b2018-08-16 20:26:42 -0700240
241 - name: Install Google Chrome
242 apt:
243 name: google-chrome-stable
244 state: present
245 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700246 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantallba4a03d2018-08-21 12:11:32 -0700247
Jessica Wagantall6e96b2e2018-08-21 14:38:37 -0700248 - name: Install Erlang dependency packages
249 apt:
250 name:
Jessica Wagantall6e96b2e2018-08-21 14:38:37 -0700251 - libsctp1
252 - libwxbase3.0-0v5
253 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700254 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantall6e96b2e2018-08-21 14:38:37 -0700255
Bengt Thureefaeb7272022-09-08 14:58:31 +1000256 - name: Install Erlang dependency package libwxgtk3 for 18.04
257 apt:
258 name:
259 - libwxgtk3.0-0v5
260 become: true
Andrew Grimberga6b750c2023-05-03 08:47:44 -0700261 # yamllint disable-line rule:line-length
Bengt Thureefaeb7272022-09-08 14:58:31 +1000262 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' and ansible_distribution_version == '18.04'
263
264 - name: Install Erlang dependency package libwxgtk3 for 20.04
265 apt:
266 name:
267 - libwxgtk3.0-gtk3-0v5
268 become: true
Andrew Grimberga6b750c2023-05-03 08:47:44 -0700269 # yamllint disable-line rule:line-length
Bengt Thureefaeb7272022-09-08 14:58:31 +1000270 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' and ansible_distribution_version == '20.04'
271
Jessica Wagantalled075ef2022-09-09 10:44:44 -0700272 - name: Download and install libssl Ubuntu 20.04
273 apt:
Jessica Wagantall6d4f8ac2023-04-14 11:47:09 -0700274 deb: http://security.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.11_amd64.deb
Jessica Wagantalled075ef2022-09-09 10:44:44 -0700275 become: true
Andrew Grimberga6b750c2023-05-03 08:47:44 -0700276 # yamllint disable-line rule:line-length
Jessica Wagantalled075ef2022-09-09 10:44:44 -0700277 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' and ansible_distribution_version == '20.04'
278
Jessica Wagantall6e96b2e2018-08-21 14:38:37 -0700279 - name: Install Erlang
280 apt:
Jessica Wagantall8773a102022-09-12 10:01:30 -0700281 deb: https://packages.erlang-solutions.com/erlang/debian/pool/esl-erlang_24.1-1~ubuntu~trusty_amd64.deb
Jessica Wagantall6e96b2e2018-08-21 14:38:37 -0700282 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700283 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantall6e96b2e2018-08-21 14:38:37 -0700284
Andrew Grimberga6b750c2023-05-03 08:47:44 -0700285 - name: "Download latest rebar3 bin"
Eric Ball8fa57d22022-07-11 09:07:36 -0700286 command: curl -o /usr/bin/rebar3 -L "https://s3.amazonaws.com/rebar3/rebar3"
Jessica Wagantall58744aa2018-08-21 17:48:03 -0700287 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700288 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantallba4a03d2018-08-21 12:11:32 -0700289
Eric Ball8fa57d22022-07-11 09:07:36 -0700290 - file:
291 path: /usr/bin/rebar3
292 mode: "+x"
293 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700294 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantall49f835a2018-08-23 15:08:54 -0700295
296 - name: Download geckodriver
297 unarchive:
298 src: https://github.com/mozilla/geckodriver/releases/download/v0.18.0/geckodriver-v0.18.0-linux64.tar.gz
299 dest: /usr/bin
Jessica Wagantallb4cf59a2018-08-24 12:17:49 -0700300 mode: 0755
Andrew Grimberga6b750c2023-05-03 08:47:44 -0700301 remote_src: true
Jessica Wagantall49f835a2018-08-23 15:08:54 -0700302 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700303 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantallc944ef02018-08-30 17:53:11 -0700304
305 - name: Download Firefox version 55.0.3
306 unarchive:
Andrew Grimberga6b750c2023-05-03 08:47:44 -0700307 # yamllint disable-line rule:line-length
Jessica Wagantallc944ef02018-08-30 17:53:11 -0700308 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 -0700309 dest: /opt
Jessica Wagantallc944ef02018-08-30 17:53:11 -0700310 mode: 0755
Andrew Grimberga6b750c2023-05-03 08:47:44 -0700311 remote_src: true
Jessica Wagantallc944ef02018-08-30 17:53:11 -0700312 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700313 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantallc944ef02018-08-30 17:53:11 -0700314
315 - name: Create symbolic link to firefox bin
316 file:
Jessica Wagantallbbdb4d62018-09-24 18:21:48 -0700317 src: "/opt/firefox/firefox"
Jessica Wagantallc944ef02018-08-30 17:53:11 -0700318 dest: "/usr/bin/firefox"
319 state: link
320 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700321 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Vanessa Rene Valderramadc363272019-06-27 15:37:37 -0500322
323 - name: Install jinja2
324 pip:
325 name: jinja2
326 state: present
327 become: true
328 when: ansible_architecture == 'x86_64'