Jessica Wagantall | 564913e | 2018-03-19 13:41:33 -0700 | [diff] [blame] | 1 | --- |
| 2 | - import_playbook: ../common-packer/provision/docker.yaml |
| 3 | |
| 4 | - hosts: all |
| 5 | become_user: root |
| 6 | become_method: sudo |
Jessica Wagantall | 0cd3700 | 2018-03-27 16:14:46 -0700 | [diff] [blame] | 7 | vars: |
Jessica Wagantall | 5db567b | 2018-08-16 20:26:42 -0700 | [diff] [blame] | 8 | apt_file: /etc/apt/sources.list.d/google-chrome.list |
Jessica Wagantall | 0cd3700 | 2018-03-27 16:14:46 -0700 | [diff] [blame] | 9 | docker_compose_version: 1.17.1 |
| 10 | glide_checksum: sha256:c403933503ea40308ecfadcff581ff0dc3190c57958808bb9eed016f13f6f32c |
| 11 | glide_version: v0.13.1 |
Jessica Wagantall | 0cd3700 | 2018-03-27 16:14:46 -0700 | [diff] [blame] | 12 | golang_version: 1.9.1 |
Jessica Wagantall | ca8c524 | 2021-06-21 19:55:40 -0700 | [diff] [blame] | 13 | npm_version: "6.14.13" |
Jessica Wagantall | 564913e | 2018-03-19 13:41:33 -0700 | [diff] [blame] | 14 | |
Jessica Wagantall | 0cd3700 | 2018-03-27 16:14:46 -0700 | [diff] [blame] | 15 | tasks: |
Martin Klozik | 7b68421 | 2019-03-27 13:55:59 +0100 | [diff] [blame] | 16 | - 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 Wagantall | 0cd3700 | 2018-03-27 16:14:46 -0700 | [diff] [blame] | 28 | - name: 'Install Docker Compose {{docker_compose_version}}' |
Jessica Wagantall | 096164e | 2018-08-15 10:07:47 -0700 | [diff] [blame] | 29 | 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 Wagantall | 564913e | 2018-03-19 13:41:33 -0700 | [diff] [blame] | 30 | become: true |
Jessica Wagantall | 0cd3700 | 2018-03-27 16:14:46 -0700 | [diff] [blame] | 31 | |
Jessica Wagantall | 5826a6a | 2018-08-11 23:38:07 -0700 | [diff] [blame] | 32 | - file: |
| 33 | path: /usr/local/bin/docker-compose |
| 34 | mode: "+x" |
Jessica Wagantall | dbadc48 | 2018-08-13 14:13:57 -0700 | [diff] [blame] | 35 | become: true |
Jessica Wagantall | 5826a6a | 2018-08-11 23:38:07 -0700 | [diff] [blame] | 36 | |
Jessica Wagantall | 0cd3700 | 2018-03-27 16:14:46 -0700 | [diff] [blame] | 37 | - name: 'Install GoLang {{golang_version}}' |
| 38 | block: |
Martin Klozik | 7b68421 | 2019-03-27 13:55:59 +0100 | [diff] [blame] | 39 | - name: 'Fetch golang {{golang_version}} to /tmp/go{{golang_version}}.linux-{{host_arch}}.tar.gz' |
Jessica Wagantall | 0cd3700 | 2018-03-27 16:14:46 -0700 | [diff] [blame] | 40 | get_url: |
Martin Klozik | 7b68421 | 2019-03-27 13:55:59 +0100 | [diff] [blame] | 41 | 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 Wagantall | 0cd3700 | 2018-03-27 16:14:46 -0700 | [diff] [blame] | 43 | checksum: '{{golang_checksum}}' |
| 44 | - name: 'Install golang {{golang_version}} to /usr/local' |
| 45 | unarchive: |
Martin Klozik | 7b68421 | 2019-03-27 13:55:59 +0100 | [diff] [blame] | 46 | src: '/tmp/go{{golang_version}}.linux-{{host_arch}}.tar.gz' |
Jessica Wagantall | 0cd3700 | 2018-03-27 16:14:46 -0700 | [diff] [blame] | 47 | dest: /usr/local |
| 48 | remote_src: true |
| 49 | become: true |
Jessica Wagantall | b4acd42 | 2018-09-05 13:38:55 -0700 | [diff] [blame] | 50 | - 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 Wagantall | 0cd3700 | 2018-03-27 16:14:46 -0700 | [diff] [blame] | 55 | become: true |
Jessica Wagantall | 19ce2f5 | 2018-08-08 12:25:08 -0700 | [diff] [blame] | 56 | |
| 57 | - name: Install libxml2-utils |
| 58 | apt: |
| 59 | name: libxml2-utils |
| 60 | state: present |
| 61 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 62 | when: ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 7f93ce0 | 2018-08-09 19:41:49 -0700 | [diff] [blame] | 63 | |
Jessica Wagantall | 0b9a6b2 | 2020-02-24 13:47:24 -0800 | [diff] [blame] | 64 | - name: Install python-tox and deps |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 65 | pip: |
Jessica Wagantall | 0b9a6b2 | 2020-02-24 13:47:24 -0800 | [diff] [blame] | 66 | name: |
| 67 | - tox |
| 68 | - tox-pyenv |
| 69 | - virtualenv |
| 70 | - more-itertools~=5.0.0 |
| 71 | - zipp==1.0.0 |
Jessica Wagantall | 7f93ce0 | 2018-08-09 19:41:49 -0700 | [diff] [blame] | 72 | state: present |
| 73 | become: true |
Jessica Wagantall | 42bf827 | 2018-08-09 22:02:42 -0700 | [diff] [blame] | 74 | |
| 75 | - apt_repository: |
efiacor | 27f55b7 | 2019-11-27 20:02:52 +0000 | [diff] [blame] | 76 | repo: ppa:deadsnakes/ppa |
| 77 | state: present |
| 78 | become: true |
| 79 | when: ansible_distribution == 'Ubuntu' |
| 80 | |
Jessica Wagantall | 42bf827 | 2018-08-09 22:02:42 -0700 | [diff] [blame] | 81 | - name: Update and upgrade apt packages |
| 82 | apt: |
Bengt Thuree | 4e2a3e8 | 2020-03-26 12:22:18 +1100 | [diff] [blame] | 83 | upgrade: 'yes' |
Jessica Wagantall | 42bf827 | 2018-08-09 22:02:42 -0700 | [diff] [blame] | 84 | update_cache: yes |
| 85 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 86 | when: ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 42bf827 | 2018-08-09 22:02:42 -0700 | [diff] [blame] | 87 | |
| 88 | - name: Install Python 3.6 and packages |
| 89 | apt: |
| 90 | name: |
| 91 | - python3.6 |
| 92 | - python3.6-dev |
Milin | 3fabeee | 2019-09-05 14:52:31 -0500 | [diff] [blame] | 93 | - python3.6-tk |
Jessica Wagantall | 42bf827 | 2018-08-09 22:02:42 -0700 | [diff] [blame] | 94 | - libssl-dev |
| 95 | - libmysqlclient-dev |
| 96 | - gcc |
Jessica Wagantall | 175d5ef | 2020-02-20 10:23:58 -0800 | [diff] [blame] | 97 | - python3-venv |
Jessica Wagantall | 42bf827 | 2018-08-09 22:02:42 -0700 | [diff] [blame] | 98 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 99 | when: ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 3fc37fe | 2018-08-10 00:16:16 -0700 | [diff] [blame] | 100 | |
efiacor | 27f55b7 | 2019-11-27 20:02:52 +0000 | [diff] [blame] | 101 | - 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 | |
vv770d | 4f9ba44 | 2020-07-17 20:46:45 +0000 | [diff] [blame] | 110 | - 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 Jagiello | 9f7857e | 2021-01-22 22:24:57 +0000 | [diff] [blame] | 119 | - name: Install Python 3.9 |
| 120 | apt: |
| 121 | name: |
| 122 | - python3.9 |
| 123 | - python3.9-dev |
| 124 | - python3.9-tk |
Bengt Thuree | 14473ea | 2021-03-16 13:29:06 +1100 | [diff] [blame] | 125 | - python3.9-distutils |
Michal Jagiello | 9f7857e | 2021-01-22 22:24:57 +0000 | [diff] [blame] | 126 | become: true |
| 127 | when: ansible_distribution == 'Ubuntu' |
| 128 | |
Jessica Wagantall | dbba0aa | 2020-03-16 09:28:18 -0700 | [diff] [blame] | 129 | - 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 Wagantall | d919c8c | 2020-03-16 11:49:37 -0700 | [diff] [blame] | 138 | - 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 Wagantall | dbba0aa | 2020-03-16 09:28:18 -0700 | [diff] [blame] | 147 | - name: Install supporting packages |
Jessica Wagantall | 3fc37fe | 2018-08-10 00:16:16 -0700 | [diff] [blame] | 148 | apt: |
| 149 | name: |
| 150 | - unzip |
| 151 | - xz-utils |
| 152 | - libxml-xpath-perl |
| 153 | - wget |
| 154 | - make |
Jessica Wagantall | 3fc37fe | 2018-08-10 00:16:16 -0700 | [diff] [blame] | 155 | - sshuttle |
| 156 | - netcat |
| 157 | - libssl-dev |
| 158 | - libffi-dev |
Jessica Wagantall | 3fc37fe | 2018-08-10 00:16:16 -0700 | [diff] [blame] | 159 | - xmlstarlet |
| 160 | - xvfb |
| 161 | - crudini |
| 162 | - maven |
| 163 | - python-ncclient |
Jessica Wagantall | 2520197 | 2020-02-19 12:00:04 -0800 | [diff] [blame] | 164 | - xmlstarlet |
| 165 | - xvfb |
| 166 | - crudini |
| 167 | - maven |
| 168 | - python-ncclient |
Jessica Wagantall | 2520197 | 2020-02-19 12:00:04 -0800 | [diff] [blame] | 169 | update_cache: yes |
Jessica Wagantall | 307720b | 2020-03-12 20:56:49 -0700 | [diff] [blame] | 170 | state: fixed |
| 171 | become: true |
| 172 | when: ansible_distribution == 'Ubuntu' |
| 173 | |
Jessica Wagantall | dbba0aa | 2020-03-16 09:28:18 -0700 | [diff] [blame] | 174 | - name: Install npm and addon packages |
Jessica Wagantall | 307720b | 2020-03-12 20:56:49 -0700 | [diff] [blame] | 175 | apt: |
| 176 | name: |
Jessica Wagantall | dbba0aa | 2020-03-16 09:28:18 -0700 | [diff] [blame] | 177 | - nodejs |
| 178 | - npm |
Jessica Wagantall | 307720b | 2020-03-12 20:56:49 -0700 | [diff] [blame] | 179 | - node-gyp |
| 180 | update_cache: yes |
| 181 | state: fixed |
Jessica Wagantall | 3fc37fe | 2018-08-10 00:16:16 -0700 | [diff] [blame] | 182 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 183 | when: ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 5db567b | 2018-08-16 20:26:42 -0700 | [diff] [blame] | 184 | |
Jessica Wagantall | ca8c524 | 2021-06-21 19:55:40 -0700 | [diff] [blame] | 185 | - 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 Wagantall | 5db567b | 2018-08-16 20:26:42 -0700 | [diff] [blame] | 197 | - 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 Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 202 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 5db567b | 2018-08-16 20:26:42 -0700 | [diff] [blame] | 203 | |
| 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 Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 207 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 5db567b | 2018-08-16 20:26:42 -0700 | [diff] [blame] | 208 | |
| 209 | - name: Update apt cache |
| 210 | apt: update_cache=yes |
| 211 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 212 | when: ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 5db567b | 2018-08-16 20:26:42 -0700 | [diff] [blame] | 213 | |
| 214 | - name: Install Google Chrome |
| 215 | apt: |
| 216 | name: google-chrome-stable |
| 217 | state: present |
| 218 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 219 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | ba4a03d | 2018-08-21 12:11:32 -0700 | [diff] [blame] | 220 | |
Jessica Wagantall | 6e96b2e | 2018-08-21 14:38:37 -0700 | [diff] [blame] | 221 | - name: Install Erlang dependency packages |
| 222 | apt: |
| 223 | name: |
| 224 | - libwxgtk3.0-0v5 |
| 225 | - libsctp1 |
| 226 | - libwxbase3.0-0v5 |
| 227 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 228 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 6e96b2e | 2018-08-21 14:38:37 -0700 | [diff] [blame] | 229 | |
| 230 | - name: Install Erlang |
| 231 | apt: |
Vanessa Rene Valderrama | 6eea169 | 2019-06-28 14:39:51 -0500 | [diff] [blame] | 232 | deb: https://packages.erlang-solutions.com/erlang/debian/pool/esl-erlang_19.3.6-1~ubuntu~trusty_amd64.deb |
Jessica Wagantall | 6e96b2e | 2018-08-21 14:38:37 -0700 | [diff] [blame] | 233 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 234 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 6e96b2e | 2018-08-21 14:38:37 -0700 | [diff] [blame] | 235 | |
Jessica Wagantall | ba4a03d | 2018-08-21 12:11:32 -0700 | [diff] [blame] | 236 | - name: Clone rebar3 |
| 237 | git: |
| 238 | repo: 'https://github.com/erlang/rebar3.git' |
| 239 | dest: /tmp/rebar3 |
Jessica Wagantall | 497dd98 | 2021-06-28 18:08:06 -0700 | [diff] [blame] | 240 | version: v3.13 |
| 241 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
| 242 | |
Jessica Wagantall | 79c7766 | 2018-08-21 14:16:28 -0700 | [diff] [blame] | 243 | - name: Install rebar3 to bin |
| 244 | copy: |
| 245 | src: /tmp/rebar3/rebar3 |
| 246 | dest: /usr/bin/rebar3 |
Jessica Wagantall | b4cf59a | 2018-08-24 12:17:49 -0700 | [diff] [blame] | 247 | mode: 0755 |
Jessica Wagantall | 79c7766 | 2018-08-21 14:16:28 -0700 | [diff] [blame] | 248 | remote_src: true |
Jessica Wagantall | 58744aa | 2018-08-21 17:48:03 -0700 | [diff] [blame] | 249 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 250 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | ba4a03d | 2018-08-21 12:11:32 -0700 | [diff] [blame] | 251 | |
| 252 | - name: Remove unused rebar3 source |
| 253 | file: |
| 254 | path: /tmp/rebar3 |
| 255 | state: absent |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 256 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 49f835a | 2018-08-23 15:08:54 -0700 | [diff] [blame] | 257 | |
| 258 | - name: Download geckodriver |
| 259 | unarchive: |
| 260 | src: https://github.com/mozilla/geckodriver/releases/download/v0.18.0/geckodriver-v0.18.0-linux64.tar.gz |
| 261 | dest: /usr/bin |
Jessica Wagantall | b4cf59a | 2018-08-24 12:17:49 -0700 | [diff] [blame] | 262 | mode: 0755 |
Jessica Wagantall | 49f835a | 2018-08-23 15:08:54 -0700 | [diff] [blame] | 263 | remote_src: yes |
| 264 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 265 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | c944ef0 | 2018-08-30 17:53:11 -0700 | [diff] [blame] | 266 | |
| 267 | - name: Download Firefox version 55.0.3 |
| 268 | unarchive: |
| 269 | 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 Wagantall | bbdb4d6 | 2018-09-24 18:21:48 -0700 | [diff] [blame] | 270 | dest: /opt |
Jessica Wagantall | c944ef0 | 2018-08-30 17:53:11 -0700 | [diff] [blame] | 271 | mode: 0755 |
| 272 | remote_src: yes |
| 273 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 274 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | c944ef0 | 2018-08-30 17:53:11 -0700 | [diff] [blame] | 275 | |
| 276 | - name: Create symbolic link to firefox bin |
| 277 | file: |
Jessica Wagantall | bbdb4d6 | 2018-09-24 18:21:48 -0700 | [diff] [blame] | 278 | src: "/opt/firefox/firefox" |
Jessica Wagantall | c944ef0 | 2018-08-30 17:53:11 -0700 | [diff] [blame] | 279 | dest: "/usr/bin/firefox" |
| 280 | state: link |
| 281 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 282 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Vanessa Rene Valderrama | dc36327 | 2019-06-27 15:37:37 -0500 | [diff] [blame] | 283 | |
| 284 | - name: Install jinja2 |
| 285 | pip: |
| 286 | name: jinja2 |
| 287 | state: present |
| 288 | become: true |
| 289 | when: ansible_architecture == 'x86_64' |