blob: 32aa2c3070410a277b24f037dece241bb8e9636d [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 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 Wagantall42bf8272018-08-09 22:02:42 -070064 - apt_repository:
efiacor27f55b72019-11-27 20:02:52 +000065 repo: ppa:deadsnakes/ppa
66 state: present
67 become: true
68 when: ansible_distribution == 'Ubuntu'
69
Jessica Wagantall42bf8272018-08-09 22:02:42 -070070 - name: Update and upgrade apt packages
71 apt:
Bengt Thuree4e2a3e82020-03-26 12:22:18 +110072 upgrade: 'yes'
Jessica Wagantall42bf8272018-08-09 22:02:42 -070073 update_cache: yes
74 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -070075 when: ansible_distribution == 'Ubuntu'
Jessica Wagantall42bf8272018-08-09 22:02:42 -070076
77 - name: Install Python 3.6 and packages
78 apt:
79 name:
80 - python3.6
81 - python3.6-dev
Milin3fabeee2019-09-05 14:52:31 -050082 - python3.6-tk
Jessica Wagantall42bf8272018-08-09 22:02:42 -070083 - libssl-dev
84 - libmysqlclient-dev
85 - gcc
Jessica Wagantall175d5ef2020-02-20 10:23:58 -080086 - python3-venv
Jessica Wagantall42bf8272018-08-09 22:02:42 -070087 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -070088 when: ansible_distribution == 'Ubuntu'
Jessica Wagantall3fc37fe2018-08-10 00:16:16 -070089
efiacor27f55b72019-11-27 20:02:52 +000090 - name: Install Python 3.7
91 apt:
92 name:
93 - python3.7
94 - python3.7-dev
95 - python3.7-tk
96 become: true
97 when: ansible_distribution == 'Ubuntu'
98
vv770d4f9ba442020-07-17 20:46:45 +000099 - name: Install Python 3.8
100 apt:
101 name:
102 - python3.8
103 - python3.8-dev
104 - python3.8-tk
105 become: true
106 when: ansible_distribution == 'Ubuntu'
107
Michal Jagiello9f7857e2021-01-22 22:24:57 +0000108 - name: Install Python 3.9
109 apt:
110 name:
111 - python3.9
112 - python3.9-dev
113 - python3.9-tk
Bengt Thuree14473ea2021-03-16 13:29:06 +1100114 - python3.9-distutils
Michal Jagiello9f7857e2021-01-22 22:24:57 +0000115 become: true
116 when: ansible_distribution == 'Ubuntu'
117
Jessica Wagantalldbba0aa2020-03-16 09:28:18 -0700118 - name: Install nodejs-dev libssl1.0-dev dep
119 apt:
120 name:
121 - libssl1.0-dev
122 update_cache: yes
123 state: fixed
124 become: true
125 when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '18.04'
126
Jessica Wagantalld919c8c2020-03-16 11:49:37 -0700127 - name: Install nodejs-dev dep for npm
128 apt:
129 name:
130 - nodejs-dev
131 update_cache: yes
132 state: fixed
133 become: true
Bengt Thuree4844bb92022-08-30 14:32:23 +1000134 when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '18.04'
135
136 - name: Install libnode-dev dep for npm
137 apt:
138 name: libnode-dev
139 update_cache: yes
140 state: fixed
141 become: true
142 when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '20.04'
Jessica Wagantalld919c8c2020-03-16 11:49:37 -0700143
Jessica Wagantallaea673b2022-09-06 12:28:28 -0700144 - name: Install supporting packages (Ubuntu 18.04)
Jessica Wagantall3fc37fe2018-08-10 00:16:16 -0700145 apt:
146 name:
147 - unzip
148 - xz-utils
149 - libxml-xpath-perl
150 - wget
151 - make
Jessica Wagantall3fc37fe2018-08-10 00:16:16 -0700152 - sshuttle
153 - netcat
154 - libssl-dev
155 - libffi-dev
Jessica Wagantall3fc37fe2018-08-10 00:16:16 -0700156 - xmlstarlet
157 - xvfb
158 - crudini
159 - maven
160 - python-ncclient
Jessica Wagantallaea673b2022-09-06 12:28:28 -0700161 update_cache: yes
162 state: fixed
163 become: true
164 when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '18.04'
165
166 - name: Install supporting packages (Ubuntu 20.04)
167 apt:
168 name:
169 - unzip
170 - xz-utils
171 - libxml-xpath-perl
172 - wget
173 - make
174 - sshuttle
175 - netcat
176 - libssl-dev
177 - libffi-dev
Jessica Wagantall25201972020-02-19 12:00:04 -0800178 - xmlstarlet
179 - xvfb
180 - crudini
181 - maven
Bengt Thuree1610dcb2022-09-08 19:26:17 +1000182 - python3-ncclient
Jessica Wagantall25201972020-02-19 12:00:04 -0800183 update_cache: yes
Jessica Wagantall307720b2020-03-12 20:56:49 -0700184 state: fixed
185 become: true
Jessica Wagantallaea673b2022-09-06 12:28:28 -0700186 when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '20.04'
Jessica Wagantall307720b2020-03-12 20:56:49 -0700187
Jessica Wagantalldbba0aa2020-03-16 09:28:18 -0700188 - name: Install npm and addon packages
Jessica Wagantall307720b2020-03-12 20:56:49 -0700189 apt:
190 name:
Jessica Wagantalldbba0aa2020-03-16 09:28:18 -0700191 - nodejs
192 - npm
Jessica Wagantall307720b2020-03-12 20:56:49 -0700193 - node-gyp
194 update_cache: yes
195 state: fixed
Jessica Wagantall3fc37fe2018-08-10 00:16:16 -0700196 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700197 when: ansible_distribution == 'Ubuntu'
Jessica Wagantall5db567b2018-08-16 20:26:42 -0700198
Jessica Wagantallca8c5242021-06-21 19:55:40 -0700199 - name: npm self-update
200 command: npm install npm@{{ npm_version }} -g
201 become: true
Jessica Wagantall1c371f02022-09-06 18:40:47 -0700202 when: ansible_distribution == 'Ubuntu'
Jessica Wagantallca8c5242021-06-21 19:55:40 -0700203
204 - name: npm install n module
205 command: npm install n -g
206 become: true
Jessica Wagantall1c371f02022-09-06 18:40:47 -0700207 when: ansible_distribution == 'Ubuntu'
Jessica Wagantallca8c5242021-06-21 19:55:40 -0700208
209 - name: Upgrade latest stable node version
210 command: n stable | PATH="$PATH"
211 become: true
Jessica Wagantall1c371f02022-09-06 18:40:47 -0700212 when: ansible_distribution == 'Ubuntu'
Jessica Wagantallca8c5242021-06-21 19:55:40 -0700213
Jessica Wagantall5db567b2018-08-16 20:26:42 -0700214 - name: Add Google Chrome key
215 apt_key:
216 url: https://dl-ssl.google.com/linux/linux_signing_key.pub
217 state: present
218 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700219 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantall5db567b2018-08-16 20:26:42 -0700220
221 - name: Add Google Chrome repo
222 copy: content="deb http://dl.google.com/linux/chrome/deb/ stable main" dest={{apt_file}} owner=root group=root mode=644
223 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700224 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantall5db567b2018-08-16 20:26:42 -0700225
226 - name: Update apt cache
227 apt: update_cache=yes
228 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700229 when: ansible_distribution == 'Ubuntu'
Jessica Wagantall5db567b2018-08-16 20:26:42 -0700230
231 - name: Install Google Chrome
232 apt:
233 name: google-chrome-stable
234 state: present
235 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700236 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantallba4a03d2018-08-21 12:11:32 -0700237
Jessica Wagantall6e96b2e2018-08-21 14:38:37 -0700238 - name: Install Erlang dependency packages
239 apt:
240 name:
Jessica Wagantall6e96b2e2018-08-21 14:38:37 -0700241 - libsctp1
242 - libwxbase3.0-0v5
243 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700244 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantall6e96b2e2018-08-21 14:38:37 -0700245
Bengt Thureefaeb7272022-09-08 14:58:31 +1000246 - name: Install Erlang dependency package libwxgtk3 for 18.04
247 apt:
248 name:
249 - libwxgtk3.0-0v5
250 become: true
251 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' and ansible_distribution_version == '18.04'
252
253 - name: Install Erlang dependency package libwxgtk3 for 20.04
254 apt:
255 name:
256 - libwxgtk3.0-gtk3-0v5
257 become: true
258 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' and ansible_distribution_version == '20.04'
259
Jessica Wagantalled075ef2022-09-09 10:44:44 -0700260 - name: Download and install libssl Ubuntu 20.04
261 apt:
262 deb: http://security.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.10_amd64.deb
263 become: true
264 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' and ansible_distribution_version == '20.04'
265
Jessica Wagantall6e96b2e2018-08-21 14:38:37 -0700266 - name: Install Erlang
267 apt:
Jessica Wagantall8773a102022-09-12 10:01:30 -0700268 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 -0700269 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700270 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantall6e96b2e2018-08-21 14:38:37 -0700271
Eric Ball8fa57d22022-07-11 09:07:36 -0700272 - name: 'Download latest rebar3 bin'
273 command: curl -o /usr/bin/rebar3 -L "https://s3.amazonaws.com/rebar3/rebar3"
Jessica Wagantall58744aa2018-08-21 17:48:03 -0700274 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700275 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantallba4a03d2018-08-21 12:11:32 -0700276
Eric Ball8fa57d22022-07-11 09:07:36 -0700277 - file:
278 path: /usr/bin/rebar3
279 mode: "+x"
280 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700281 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantall49f835a2018-08-23 15:08:54 -0700282
283 - name: Download geckodriver
284 unarchive:
285 src: https://github.com/mozilla/geckodriver/releases/download/v0.18.0/geckodriver-v0.18.0-linux64.tar.gz
286 dest: /usr/bin
Jessica Wagantallb4cf59a2018-08-24 12:17:49 -0700287 mode: 0755
Jessica Wagantall49f835a2018-08-23 15:08:54 -0700288 remote_src: yes
289 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700290 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantallc944ef02018-08-30 17:53:11 -0700291
292 - name: Download Firefox version 55.0.3
293 unarchive:
294 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 -0700295 dest: /opt
Jessica Wagantallc944ef02018-08-30 17:53:11 -0700296 mode: 0755
297 remote_src: yes
298 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700299 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantallc944ef02018-08-30 17:53:11 -0700300
301 - name: Create symbolic link to firefox bin
302 file:
Jessica Wagantallbbdb4d62018-09-24 18:21:48 -0700303 src: "/opt/firefox/firefox"
Jessica Wagantallc944ef02018-08-30 17:53:11 -0700304 dest: "/usr/bin/firefox"
305 state: link
306 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700307 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Vanessa Rene Valderramadc363272019-06-27 15:37:37 -0500308
309 - name: Install jinja2
310 pip:
311 name: jinja2
312 state: present
313 become: true
314 when: ansible_architecture == 'x86_64'