blob: ca9db4139db39559481e357e5c7374c4ec866028 [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 Wagantall564913e2018-03-19 13:41:33 -070013
Jessica Wagantall0cd37002018-03-27 16:14:46 -070014 tasks:
Martin Klozik7b684212019-03-27 13:55:59 +010015 - name: "Checking for x86_64"
16 set_fact:
17 host_arch: "amd64"
18 golang_checksum: sha256:07d81c6b6b4c2dcf1b5ef7c27aaebd3691cdb40548500941f92b221147c5d9c7
19 when: "'x86_64' in ansible_architecture"
20
21 - name: "Checking for aarch64"
22 set_fact:
23 host_arch: "arm64"
24 golang_checksum: sha256:d31ecae36efea5197af271ccce86ccc2baf10d2e04f20d0fb75556ecf0614dad
25 when: "'aarch64' in ansible_architecture"
26
Jessica Wagantall0cd37002018-03-27 16:14:46 -070027 - name: 'Install Docker Compose {{docker_compose_version}}'
Jessica Wagantall096164e2018-08-15 10:07:47 -070028 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 -070029 become: true
Jessica Wagantall0cd37002018-03-27 16:14:46 -070030
Jessica Wagantall5826a6a2018-08-11 23:38:07 -070031 - file:
32 path: /usr/local/bin/docker-compose
33 mode: "+x"
Jessica Wagantalldbadc482018-08-13 14:13:57 -070034 become: true
Jessica Wagantall5826a6a2018-08-11 23:38:07 -070035
Jessica Wagantall0cd37002018-03-27 16:14:46 -070036 - name: 'Install GoLang {{golang_version}}'
37 block:
Martin Klozik7b684212019-03-27 13:55:59 +010038 - name: 'Fetch golang {{golang_version}} to /tmp/go{{golang_version}}.linux-{{host_arch}}.tar.gz'
Jessica Wagantall0cd37002018-03-27 16:14:46 -070039 get_url:
Martin Klozik7b684212019-03-27 13:55:59 +010040 url: 'https://storage.googleapis.com/golang/go{{golang_version}}.linux-{{host_arch}}.tar.gz'
41 dest: '/tmp/go{{golang_version}}.linux-{{host_arch}}.tar.gz'
Jessica Wagantall0cd37002018-03-27 16:14:46 -070042 checksum: '{{golang_checksum}}'
43 - name: 'Install golang {{golang_version}} to /usr/local'
44 unarchive:
Martin Klozik7b684212019-03-27 13:55:59 +010045 src: '/tmp/go{{golang_version}}.linux-{{host_arch}}.tar.gz'
Jessica Wagantall0cd37002018-03-27 16:14:46 -070046 dest: /usr/local
47 remote_src: true
48 become: true
Jessica Wagantallb4acd422018-09-05 13:38:55 -070049 - name: Create symbolic link to go bin
50 file:
51 src: "/usr/local/go/bin/go"
52 dest: "/usr/bin/go"
53 state: link
Jessica Wagantall0cd37002018-03-27 16:14:46 -070054 become: true
Jessica Wagantall19ce2f52018-08-08 12:25:08 -070055
56 - name: Install libxml2-utils
57 apt:
58 name: libxml2-utils
59 state: present
60 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -070061 when: ansible_distribution == 'Ubuntu'
Jessica Wagantall7f93ce02018-08-09 19:41:49 -070062
Jessica Wagantall0b9a6b22020-02-24 13:47:24 -080063 - name: Install python-tox and deps
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -070064 pip:
Jessica Wagantall0b9a6b22020-02-24 13:47:24 -080065 name:
66 - tox
67 - tox-pyenv
68 - virtualenv
69 - more-itertools~=5.0.0
70 - zipp==1.0.0
Jessica Wagantall7f93ce02018-08-09 19:41:49 -070071 state: present
72 become: true
Jessica Wagantall42bf8272018-08-09 22:02:42 -070073
74 - apt_repository:
efiacor27f55b72019-11-27 20:02:52 +000075 repo: ppa:deadsnakes/ppa
76 state: present
77 become: true
78 when: ansible_distribution == 'Ubuntu'
79
Jessica Wagantall42bf8272018-08-09 22:02:42 -070080 - name: Update and upgrade apt packages
81 apt:
Bengt Thuree4e2a3e82020-03-26 12:22:18 +110082 upgrade: 'yes'
Jessica Wagantall42bf8272018-08-09 22:02:42 -070083 update_cache: yes
84 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -070085 when: ansible_distribution == 'Ubuntu'
Jessica Wagantall42bf8272018-08-09 22:02:42 -070086
87 - name: Install Python 3.6 and packages
88 apt:
89 name:
90 - python3.6
91 - python3.6-dev
Milin3fabeee2019-09-05 14:52:31 -050092 - python3.6-tk
Jessica Wagantall42bf8272018-08-09 22:02:42 -070093 - libssl-dev
94 - libmysqlclient-dev
95 - gcc
Jessica Wagantall175d5ef2020-02-20 10:23:58 -080096 - python3-venv
Jessica Wagantall42bf8272018-08-09 22:02:42 -070097 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -070098 when: ansible_distribution == 'Ubuntu'
Jessica Wagantall3fc37fe2018-08-10 00:16:16 -070099
efiacor27f55b72019-11-27 20:02:52 +0000100 - name: Install Python 3.7
101 apt:
102 name:
103 - python3.7
104 - python3.7-dev
105 - python3.7-tk
106 become: true
107 when: ansible_distribution == 'Ubuntu'
108
vv770d4f9ba442020-07-17 20:46:45 +0000109 - name: Install Python 3.8
110 apt:
111 name:
112 - python3.8
113 - python3.8-dev
114 - python3.8-tk
115 become: true
116 when: ansible_distribution == 'Ubuntu'
117
Michal Jagiello9f7857e2021-01-22 22:24:57 +0000118 - name: Install Python 3.9
119 apt:
120 name:
121 - python3.9
122 - python3.9-dev
123 - python3.9-tk
124 become: true
125 when: ansible_distribution == 'Ubuntu'
126
Jessica Wagantalldbba0aa2020-03-16 09:28:18 -0700127 - name: Install nodejs-dev libssl1.0-dev dep
128 apt:
129 name:
130 - libssl1.0-dev
131 update_cache: yes
132 state: fixed
133 become: true
134 when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '18.04'
135
Jessica Wagantalld919c8c2020-03-16 11:49:37 -0700136 - name: Install nodejs-dev dep for npm
137 apt:
138 name:
139 - nodejs-dev
140 update_cache: yes
141 state: fixed
142 become: true
143 when: ansible_distribution == 'Ubuntu'
144
Jessica Wagantalldbba0aa2020-03-16 09:28:18 -0700145 - name: Install supporting packages
Jessica Wagantall3fc37fe2018-08-10 00:16:16 -0700146 apt:
147 name:
148 - unzip
149 - xz-utils
150 - libxml-xpath-perl
151 - wget
152 - make
Jessica Wagantall3fc37fe2018-08-10 00:16:16 -0700153 - sshuttle
154 - netcat
155 - libssl-dev
156 - libffi-dev
Jessica Wagantall3fc37fe2018-08-10 00:16:16 -0700157 - xmlstarlet
158 - xvfb
159 - crudini
160 - maven
161 - python-ncclient
Jessica Wagantall25201972020-02-19 12:00:04 -0800162 - xmlstarlet
163 - xvfb
164 - crudini
165 - maven
166 - python-ncclient
Jessica Wagantall25201972020-02-19 12:00:04 -0800167 update_cache: yes
Jessica Wagantall307720b2020-03-12 20:56:49 -0700168 state: fixed
169 become: true
170 when: ansible_distribution == 'Ubuntu'
171
Jessica Wagantalldbba0aa2020-03-16 09:28:18 -0700172 - name: Install npm and addon packages
Jessica Wagantall307720b2020-03-12 20:56:49 -0700173 apt:
174 name:
Jessica Wagantalldbba0aa2020-03-16 09:28:18 -0700175 - nodejs
176 - npm
Jessica Wagantall307720b2020-03-12 20:56:49 -0700177 - node-gyp
178 update_cache: yes
179 state: fixed
Jessica Wagantall3fc37fe2018-08-10 00:16:16 -0700180 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700181 when: ansible_distribution == 'Ubuntu'
Jessica Wagantall5db567b2018-08-16 20:26:42 -0700182
183 - name: Add Google Chrome key
184 apt_key:
185 url: https://dl-ssl.google.com/linux/linux_signing_key.pub
186 state: present
187 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700188 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantall5db567b2018-08-16 20:26:42 -0700189
190 - name: Add Google Chrome repo
191 copy: content="deb http://dl.google.com/linux/chrome/deb/ stable main" dest={{apt_file}} owner=root group=root mode=644
192 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700193 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantall5db567b2018-08-16 20:26:42 -0700194
195 - name: Update apt cache
196 apt: update_cache=yes
197 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700198 when: ansible_distribution == 'Ubuntu'
Jessica Wagantall5db567b2018-08-16 20:26:42 -0700199
200 - name: Install Google Chrome
201 apt:
202 name: google-chrome-stable
203 state: present
204 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700205 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantallba4a03d2018-08-21 12:11:32 -0700206
Jessica Wagantall6e96b2e2018-08-21 14:38:37 -0700207 - name: Install Erlang dependency packages
208 apt:
209 name:
210 - libwxgtk3.0-0v5
211 - libsctp1
212 - libwxbase3.0-0v5
213 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700214 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantall6e96b2e2018-08-21 14:38:37 -0700215
216 - name: Install Erlang
217 apt:
Vanessa Rene Valderrama6eea1692019-06-28 14:39:51 -0500218 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 -0700219 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700220 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantall6e96b2e2018-08-21 14:38:37 -0700221
Jessica Wagantallba4a03d2018-08-21 12:11:32 -0700222 - name: Clone rebar3
223 git:
224 repo: 'https://github.com/erlang/rebar3.git'
225 dest: /tmp/rebar3
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700226 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantallba4a03d2018-08-21 12:11:32 -0700227
228 - name: Bootstrap rebar3
229 command: ./bootstrap
230 args:
231 chdir: /tmp/rebar3
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700232 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantallba4a03d2018-08-21 12:11:32 -0700233
Jessica Wagantall79c77662018-08-21 14:16:28 -0700234 - name: Install rebar3 to bin
235 copy:
236 src: /tmp/rebar3/rebar3
237 dest: /usr/bin/rebar3
Jessica Wagantallb4cf59a2018-08-24 12:17:49 -0700238 mode: 0755
Jessica Wagantall79c77662018-08-21 14:16:28 -0700239 remote_src: true
Jessica Wagantall58744aa2018-08-21 17:48:03 -0700240 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700241 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantallba4a03d2018-08-21 12:11:32 -0700242
243 - name: Remove unused rebar3 source
244 file:
245 path: /tmp/rebar3
246 state: absent
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700247 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantall49f835a2018-08-23 15:08:54 -0700248
249 - name: Download geckodriver
250 unarchive:
251 src: https://github.com/mozilla/geckodriver/releases/download/v0.18.0/geckodriver-v0.18.0-linux64.tar.gz
252 dest: /usr/bin
Jessica Wagantallb4cf59a2018-08-24 12:17:49 -0700253 mode: 0755
Jessica Wagantall49f835a2018-08-23 15:08:54 -0700254 remote_src: yes
255 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700256 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantallc944ef02018-08-30 17:53:11 -0700257
258 - name: Download Firefox version 55.0.3
259 unarchive:
260 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 -0700261 dest: /opt
Jessica Wagantallc944ef02018-08-30 17:53:11 -0700262 mode: 0755
263 remote_src: yes
264 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700265 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Jessica Wagantallc944ef02018-08-30 17:53:11 -0700266
267 - name: Create symbolic link to firefox bin
268 file:
Jessica Wagantallbbdb4d62018-09-24 18:21:48 -0700269 src: "/opt/firefox/firefox"
Jessica Wagantallc944ef02018-08-30 17:53:11 -0700270 dest: "/usr/bin/firefox"
271 state: link
272 become: true
Jessica Wagantallc2bf19b2019-05-06 18:04:28 -0700273 when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu'
Vanessa Rene Valderramadc363272019-06-27 15:37:37 -0500274
275 - name: Install jinja2
276 pip:
277 name: jinja2
278 state: present
279 become: true
280 when: ansible_architecture == 'x86_64'