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 | 564913e | 2018-03-19 13:41:33 -0700 | [diff] [blame] | 13 | |
Jessica Wagantall | 0cd3700 | 2018-03-27 16:14:46 -0700 | [diff] [blame] | 14 | tasks: |
Martin Klozik | 7b68421 | 2019-03-27 13:55:59 +0100 | [diff] [blame] | 15 | - 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 Wagantall | 0cd3700 | 2018-03-27 16:14:46 -0700 | [diff] [blame] | 27 | - name: 'Install Docker Compose {{docker_compose_version}}' |
Jessica Wagantall | 096164e | 2018-08-15 10:07:47 -0700 | [diff] [blame] | 28 | 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] | 29 | become: true |
Jessica Wagantall | 0cd3700 | 2018-03-27 16:14:46 -0700 | [diff] [blame] | 30 | |
Jessica Wagantall | 5826a6a | 2018-08-11 23:38:07 -0700 | [diff] [blame] | 31 | - file: |
| 32 | path: /usr/local/bin/docker-compose |
| 33 | mode: "+x" |
Jessica Wagantall | dbadc48 | 2018-08-13 14:13:57 -0700 | [diff] [blame] | 34 | become: true |
Jessica Wagantall | 5826a6a | 2018-08-11 23:38:07 -0700 | [diff] [blame] | 35 | |
Jessica Wagantall | 0cd3700 | 2018-03-27 16:14:46 -0700 | [diff] [blame] | 36 | - name: 'Install GoLang {{golang_version}}' |
| 37 | block: |
Martin Klozik | 7b68421 | 2019-03-27 13:55:59 +0100 | [diff] [blame] | 38 | - 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] | 39 | get_url: |
Martin Klozik | 7b68421 | 2019-03-27 13:55:59 +0100 | [diff] [blame] | 40 | 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 Wagantall | 0cd3700 | 2018-03-27 16:14:46 -0700 | [diff] [blame] | 42 | checksum: '{{golang_checksum}}' |
| 43 | - name: 'Install golang {{golang_version}} to /usr/local' |
| 44 | unarchive: |
Martin Klozik | 7b68421 | 2019-03-27 13:55:59 +0100 | [diff] [blame] | 45 | src: '/tmp/go{{golang_version}}.linux-{{host_arch}}.tar.gz' |
Jessica Wagantall | 0cd3700 | 2018-03-27 16:14:46 -0700 | [diff] [blame] | 46 | dest: /usr/local |
| 47 | remote_src: true |
| 48 | become: true |
Jessica Wagantall | b4acd42 | 2018-09-05 13:38:55 -0700 | [diff] [blame] | 49 | - 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 Wagantall | 0cd3700 | 2018-03-27 16:14:46 -0700 | [diff] [blame] | 54 | become: true |
Jessica Wagantall | 19ce2f5 | 2018-08-08 12:25:08 -0700 | [diff] [blame] | 55 | |
| 56 | - name: Install libxml2-utils |
| 57 | apt: |
| 58 | name: libxml2-utils |
| 59 | state: present |
| 60 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 61 | when: ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 7f93ce0 | 2018-08-09 19:41:49 -0700 | [diff] [blame] | 62 | |
Jessica Wagantall | 0b9a6b2 | 2020-02-24 13:47:24 -0800 | [diff] [blame] | 63 | - name: Install python-tox and deps |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 64 | pip: |
Jessica Wagantall | 0b9a6b2 | 2020-02-24 13:47:24 -0800 | [diff] [blame] | 65 | name: |
| 66 | - tox |
| 67 | - tox-pyenv |
| 68 | - virtualenv |
| 69 | - more-itertools~=5.0.0 |
| 70 | - zipp==1.0.0 |
Jessica Wagantall | 7f93ce0 | 2018-08-09 19:41:49 -0700 | [diff] [blame] | 71 | state: present |
| 72 | become: true |
Jessica Wagantall | 42bf827 | 2018-08-09 22:02:42 -0700 | [diff] [blame] | 73 | |
| 74 | - apt_repository: |
efiacor | 27f55b7 | 2019-11-27 20:02:52 +0000 | [diff] [blame] | 75 | repo: ppa:deadsnakes/ppa |
| 76 | state: present |
| 77 | become: true |
| 78 | when: ansible_distribution == 'Ubuntu' |
| 79 | |
Jessica Wagantall | 42bf827 | 2018-08-09 22:02:42 -0700 | [diff] [blame] | 80 | - name: Update and upgrade apt packages |
| 81 | apt: |
| 82 | upgrade: yes |
| 83 | update_cache: yes |
| 84 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 85 | when: ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 42bf827 | 2018-08-09 22:02:42 -0700 | [diff] [blame] | 86 | |
| 87 | - name: Install Python 3.6 and packages |
| 88 | apt: |
| 89 | name: |
| 90 | - python3.6 |
| 91 | - python3.6-dev |
Milin | 3fabeee | 2019-09-05 14:52:31 -0500 | [diff] [blame] | 92 | - python3.6-tk |
Jessica Wagantall | 42bf827 | 2018-08-09 22:02:42 -0700 | [diff] [blame] | 93 | - libssl-dev |
| 94 | - libmysqlclient-dev |
| 95 | - gcc |
Jessica Wagantall | 175d5ef | 2020-02-20 10:23:58 -0800 | [diff] [blame] | 96 | - python3-venv |
Jessica Wagantall | 42bf827 | 2018-08-09 22:02:42 -0700 | [diff] [blame] | 97 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 98 | when: ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 3fc37fe | 2018-08-10 00:16:16 -0700 | [diff] [blame] | 99 | |
efiacor | 27f55b7 | 2019-11-27 20:02:52 +0000 | [diff] [blame] | 100 | - 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 | |
Jessica Wagantall | dbba0aa | 2020-03-16 09:28:18 -0700 | [diff] [blame] | 109 | - name: Install nodejs-dev libssl1.0-dev dep |
| 110 | apt: |
| 111 | name: |
| 112 | - libssl1.0-dev |
| 113 | update_cache: yes |
| 114 | state: fixed |
| 115 | become: true |
| 116 | when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '18.04' |
| 117 | |
Jessica Wagantall | d919c8c | 2020-03-16 11:49:37 -0700 | [diff] [blame] | 118 | - name: Install nodejs-dev dep for npm |
| 119 | apt: |
| 120 | name: |
| 121 | - nodejs-dev |
| 122 | update_cache: yes |
| 123 | state: fixed |
| 124 | become: true |
| 125 | when: ansible_distribution == 'Ubuntu' |
| 126 | |
Jessica Wagantall | dbba0aa | 2020-03-16 09:28:18 -0700 | [diff] [blame] | 127 | - name: Install supporting packages |
Jessica Wagantall | 3fc37fe | 2018-08-10 00:16:16 -0700 | [diff] [blame] | 128 | apt: |
| 129 | name: |
| 130 | - unzip |
| 131 | - xz-utils |
| 132 | - libxml-xpath-perl |
| 133 | - wget |
| 134 | - make |
Jessica Wagantall | 3fc37fe | 2018-08-10 00:16:16 -0700 | [diff] [blame] | 135 | - sshuttle |
| 136 | - netcat |
| 137 | - libssl-dev |
| 138 | - libffi-dev |
Jessica Wagantall | 3fc37fe | 2018-08-10 00:16:16 -0700 | [diff] [blame] | 139 | - xmlstarlet |
| 140 | - xvfb |
| 141 | - crudini |
| 142 | - maven |
| 143 | - python-ncclient |
Jessica Wagantall | 2520197 | 2020-02-19 12:00:04 -0800 | [diff] [blame] | 144 | - xmlstarlet |
| 145 | - xvfb |
| 146 | - crudini |
| 147 | - maven |
| 148 | - python-ncclient |
Jessica Wagantall | 2520197 | 2020-02-19 12:00:04 -0800 | [diff] [blame] | 149 | update_cache: yes |
Jessica Wagantall | 307720b | 2020-03-12 20:56:49 -0700 | [diff] [blame] | 150 | state: fixed |
| 151 | become: true |
| 152 | when: ansible_distribution == 'Ubuntu' |
| 153 | |
Jessica Wagantall | dbba0aa | 2020-03-16 09:28:18 -0700 | [diff] [blame] | 154 | - name: Install npm and addon packages |
Jessica Wagantall | 307720b | 2020-03-12 20:56:49 -0700 | [diff] [blame] | 155 | apt: |
| 156 | name: |
Jessica Wagantall | dbba0aa | 2020-03-16 09:28:18 -0700 | [diff] [blame] | 157 | - nodejs |
| 158 | - npm |
Jessica Wagantall | 307720b | 2020-03-12 20:56:49 -0700 | [diff] [blame] | 159 | - node-gyp |
| 160 | update_cache: yes |
| 161 | state: fixed |
Jessica Wagantall | 3fc37fe | 2018-08-10 00:16:16 -0700 | [diff] [blame] | 162 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 163 | when: ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 5db567b | 2018-08-16 20:26:42 -0700 | [diff] [blame] | 164 | |
| 165 | - name: Add Google Chrome key |
| 166 | apt_key: |
| 167 | url: https://dl-ssl.google.com/linux/linux_signing_key.pub |
| 168 | state: present |
| 169 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 170 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 5db567b | 2018-08-16 20:26:42 -0700 | [diff] [blame] | 171 | |
| 172 | - name: Add Google Chrome repo |
| 173 | copy: content="deb http://dl.google.com/linux/chrome/deb/ stable main" dest={{apt_file}} owner=root group=root mode=644 |
| 174 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 175 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 5db567b | 2018-08-16 20:26:42 -0700 | [diff] [blame] | 176 | |
| 177 | - name: Update apt cache |
| 178 | apt: update_cache=yes |
| 179 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 180 | when: ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 5db567b | 2018-08-16 20:26:42 -0700 | [diff] [blame] | 181 | |
| 182 | - name: Install Google Chrome |
| 183 | apt: |
| 184 | name: google-chrome-stable |
| 185 | state: present |
| 186 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 187 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | ba4a03d | 2018-08-21 12:11:32 -0700 | [diff] [blame] | 188 | |
Jessica Wagantall | 6e96b2e | 2018-08-21 14:38:37 -0700 | [diff] [blame] | 189 | - name: Install Erlang dependency packages |
| 190 | apt: |
| 191 | name: |
| 192 | - libwxgtk3.0-0v5 |
| 193 | - libsctp1 |
| 194 | - libwxbase3.0-0v5 |
| 195 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 196 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 6e96b2e | 2018-08-21 14:38:37 -0700 | [diff] [blame] | 197 | |
| 198 | - name: Install Erlang |
| 199 | apt: |
Vanessa Rene Valderrama | 6eea169 | 2019-06-28 14:39:51 -0500 | [diff] [blame] | 200 | 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] | 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 | 6e96b2e | 2018-08-21 14:38:37 -0700 | [diff] [blame] | 203 | |
Jessica Wagantall | ba4a03d | 2018-08-21 12:11:32 -0700 | [diff] [blame] | 204 | - name: Clone rebar3 |
| 205 | git: |
| 206 | repo: 'https://github.com/erlang/rebar3.git' |
| 207 | dest: /tmp/rebar3 |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 208 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | ba4a03d | 2018-08-21 12:11:32 -0700 | [diff] [blame] | 209 | |
| 210 | - name: Bootstrap rebar3 |
| 211 | command: ./bootstrap |
| 212 | args: |
| 213 | chdir: /tmp/rebar3 |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 214 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | ba4a03d | 2018-08-21 12:11:32 -0700 | [diff] [blame] | 215 | |
Jessica Wagantall | 79c7766 | 2018-08-21 14:16:28 -0700 | [diff] [blame] | 216 | - name: Install rebar3 to bin |
| 217 | copy: |
| 218 | src: /tmp/rebar3/rebar3 |
| 219 | dest: /usr/bin/rebar3 |
Jessica Wagantall | b4cf59a | 2018-08-24 12:17:49 -0700 | [diff] [blame] | 220 | mode: 0755 |
Jessica Wagantall | 79c7766 | 2018-08-21 14:16:28 -0700 | [diff] [blame] | 221 | remote_src: true |
Jessica Wagantall | 58744aa | 2018-08-21 17:48:03 -0700 | [diff] [blame] | 222 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 223 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | ba4a03d | 2018-08-21 12:11:32 -0700 | [diff] [blame] | 224 | |
| 225 | - name: Remove unused rebar3 source |
| 226 | file: |
| 227 | path: /tmp/rebar3 |
| 228 | state: absent |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 229 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 49f835a | 2018-08-23 15:08:54 -0700 | [diff] [blame] | 230 | |
| 231 | - name: Download geckodriver |
| 232 | unarchive: |
| 233 | src: https://github.com/mozilla/geckodriver/releases/download/v0.18.0/geckodriver-v0.18.0-linux64.tar.gz |
| 234 | dest: /usr/bin |
Jessica Wagantall | b4cf59a | 2018-08-24 12:17:49 -0700 | [diff] [blame] | 235 | mode: 0755 |
Jessica Wagantall | 49f835a | 2018-08-23 15:08:54 -0700 | [diff] [blame] | 236 | remote_src: yes |
| 237 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 238 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | c944ef0 | 2018-08-30 17:53:11 -0700 | [diff] [blame] | 239 | |
| 240 | - name: Download Firefox version 55.0.3 |
| 241 | unarchive: |
| 242 | 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] | 243 | dest: /opt |
Jessica Wagantall | c944ef0 | 2018-08-30 17:53:11 -0700 | [diff] [blame] | 244 | mode: 0755 |
| 245 | remote_src: yes |
| 246 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 247 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | c944ef0 | 2018-08-30 17:53:11 -0700 | [diff] [blame] | 248 | |
| 249 | - name: Create symbolic link to firefox bin |
| 250 | file: |
Jessica Wagantall | bbdb4d6 | 2018-09-24 18:21:48 -0700 | [diff] [blame] | 251 | src: "/opt/firefox/firefox" |
Jessica Wagantall | c944ef0 | 2018-08-30 17:53:11 -0700 | [diff] [blame] | 252 | dest: "/usr/bin/firefox" |
| 253 | state: link |
| 254 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 255 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Vanessa Rene Valderrama | dc36327 | 2019-06-27 15:37:37 -0500 | [diff] [blame] | 256 | |
| 257 | - name: Install jinja2 |
| 258 | pip: |
| 259 | name: jinja2 |
| 260 | state: present |
| 261 | become: true |
| 262 | when: ansible_architecture == 'x86_64' |