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 | |
| 63 | - name: Install python-tox |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 64 | pip: |
| 65 | name: tox |
Jessica Wagantall | 7f93ce0 | 2018-08-09 19:41:49 -0700 | [diff] [blame] | 66 | state: present |
| 67 | become: true |
Jessica Wagantall | 42bf827 | 2018-08-09 22:02:42 -0700 | [diff] [blame] | 68 | |
| 69 | - apt_repository: |
| 70 | repo: ppa:jonathonf/python-3.6 |
| 71 | state: present |
| 72 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 73 | when: ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 42bf827 | 2018-08-09 22:02:42 -0700 | [diff] [blame] | 74 | |
| 75 | - name: Update and upgrade apt packages |
| 76 | apt: |
| 77 | upgrade: yes |
| 78 | update_cache: yes |
| 79 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 80 | when: ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 42bf827 | 2018-08-09 22:02:42 -0700 | [diff] [blame] | 81 | |
| 82 | - name: Install Python 3.6 and packages |
| 83 | apt: |
| 84 | name: |
| 85 | - python3.6 |
| 86 | - python3.6-dev |
Milin | 3fabeee | 2019-09-05 14:52:31 -0500 | [diff] [blame] | 87 | - python3.6-tk |
Jessica Wagantall | 42bf827 | 2018-08-09 22:02:42 -0700 | [diff] [blame] | 88 | - libssl-dev |
| 89 | - libmysqlclient-dev |
| 90 | - gcc |
| 91 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 92 | when: ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 3fc37fe | 2018-08-10 00:16:16 -0700 | [diff] [blame] | 93 | |
| 94 | - name: Install base packages |
| 95 | apt: |
| 96 | name: |
| 97 | - unzip |
| 98 | - xz-utils |
| 99 | - libxml-xpath-perl |
| 100 | - wget |
| 101 | - make |
| 102 | - npm |
| 103 | - sshuttle |
| 104 | - netcat |
| 105 | - libssl-dev |
| 106 | - libffi-dev |
| 107 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 108 | when: ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 3fc37fe | 2018-08-10 00:16:16 -0700 | [diff] [blame] | 109 | |
| 110 | - name: Install autorelease support packages |
| 111 | apt: |
| 112 | name: |
Jessica Wagantall | 3fc37fe | 2018-08-10 00:16:16 -0700 | [diff] [blame] | 113 | - xmlstarlet |
| 114 | - xvfb |
| 115 | - crudini |
| 116 | - maven |
| 117 | - python-ncclient |
| 118 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 119 | when: ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 5db567b | 2018-08-16 20:26:42 -0700 | [diff] [blame] | 120 | |
| 121 | - name: Add Google Chrome key |
| 122 | apt_key: |
| 123 | url: https://dl-ssl.google.com/linux/linux_signing_key.pub |
| 124 | state: present |
| 125 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 126 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 5db567b | 2018-08-16 20:26:42 -0700 | [diff] [blame] | 127 | |
| 128 | - name: Add Google Chrome repo |
| 129 | copy: content="deb http://dl.google.com/linux/chrome/deb/ stable main" dest={{apt_file}} owner=root group=root mode=644 |
| 130 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 131 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 5db567b | 2018-08-16 20:26:42 -0700 | [diff] [blame] | 132 | |
| 133 | - name: Update apt cache |
| 134 | apt: update_cache=yes |
| 135 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 136 | when: ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 5db567b | 2018-08-16 20:26:42 -0700 | [diff] [blame] | 137 | |
| 138 | - name: Install Google Chrome |
| 139 | apt: |
| 140 | name: google-chrome-stable |
| 141 | state: present |
| 142 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 143 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | ba4a03d | 2018-08-21 12:11:32 -0700 | [diff] [blame] | 144 | |
Jessica Wagantall | 6e96b2e | 2018-08-21 14:38:37 -0700 | [diff] [blame] | 145 | - name: Install Erlang dependency packages |
| 146 | apt: |
| 147 | name: |
| 148 | - libwxgtk3.0-0v5 |
| 149 | - libsctp1 |
| 150 | - libwxbase3.0-0v5 |
| 151 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 152 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 6e96b2e | 2018-08-21 14:38:37 -0700 | [diff] [blame] | 153 | |
| 154 | - name: Install Erlang |
| 155 | apt: |
Vanessa Rene Valderrama | 6eea169 | 2019-06-28 14:39:51 -0500 | [diff] [blame] | 156 | 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] | 157 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 158 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 6e96b2e | 2018-08-21 14:38:37 -0700 | [diff] [blame] | 159 | |
Jessica Wagantall | ba4a03d | 2018-08-21 12:11:32 -0700 | [diff] [blame] | 160 | - name: Clone rebar3 |
| 161 | git: |
| 162 | repo: 'https://github.com/erlang/rebar3.git' |
| 163 | dest: /tmp/rebar3 |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 164 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | ba4a03d | 2018-08-21 12:11:32 -0700 | [diff] [blame] | 165 | |
| 166 | - name: Bootstrap rebar3 |
| 167 | command: ./bootstrap |
| 168 | args: |
| 169 | chdir: /tmp/rebar3 |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 170 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | ba4a03d | 2018-08-21 12:11:32 -0700 | [diff] [blame] | 171 | |
Jessica Wagantall | 79c7766 | 2018-08-21 14:16:28 -0700 | [diff] [blame] | 172 | - name: Install rebar3 to bin |
| 173 | copy: |
| 174 | src: /tmp/rebar3/rebar3 |
| 175 | dest: /usr/bin/rebar3 |
Jessica Wagantall | b4cf59a | 2018-08-24 12:17:49 -0700 | [diff] [blame] | 176 | mode: 0755 |
Jessica Wagantall | 79c7766 | 2018-08-21 14:16:28 -0700 | [diff] [blame] | 177 | remote_src: true |
Jessica Wagantall | 58744aa | 2018-08-21 17:48:03 -0700 | [diff] [blame] | 178 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 179 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | ba4a03d | 2018-08-21 12:11:32 -0700 | [diff] [blame] | 180 | |
| 181 | - name: Remove unused rebar3 source |
| 182 | file: |
| 183 | path: /tmp/rebar3 |
| 184 | state: absent |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 185 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | 49f835a | 2018-08-23 15:08:54 -0700 | [diff] [blame] | 186 | |
| 187 | - name: Download geckodriver |
| 188 | unarchive: |
| 189 | src: https://github.com/mozilla/geckodriver/releases/download/v0.18.0/geckodriver-v0.18.0-linux64.tar.gz |
| 190 | dest: /usr/bin |
Jessica Wagantall | b4cf59a | 2018-08-24 12:17:49 -0700 | [diff] [blame] | 191 | mode: 0755 |
Jessica Wagantall | 49f835a | 2018-08-23 15:08:54 -0700 | [diff] [blame] | 192 | remote_src: yes |
| 193 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 194 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | c944ef0 | 2018-08-30 17:53:11 -0700 | [diff] [blame] | 195 | |
| 196 | - name: Download Firefox version 55.0.3 |
| 197 | unarchive: |
| 198 | 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] | 199 | dest: /opt |
Jessica Wagantall | c944ef0 | 2018-08-30 17:53:11 -0700 | [diff] [blame] | 200 | mode: 0755 |
| 201 | remote_src: yes |
| 202 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 203 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Jessica Wagantall | c944ef0 | 2018-08-30 17:53:11 -0700 | [diff] [blame] | 204 | |
| 205 | - name: Create symbolic link to firefox bin |
| 206 | file: |
Jessica Wagantall | bbdb4d6 | 2018-09-24 18:21:48 -0700 | [diff] [blame] | 207 | src: "/opt/firefox/firefox" |
Jessica Wagantall | c944ef0 | 2018-08-30 17:53:11 -0700 | [diff] [blame] | 208 | dest: "/usr/bin/firefox" |
| 209 | state: link |
| 210 | become: true |
Jessica Wagantall | c2bf19b | 2019-05-06 18:04:28 -0700 | [diff] [blame] | 211 | when: ansible_architecture == 'x86_64' and ansible_distribution == 'Ubuntu' |
Vanessa Rene Valderrama | dc36327 | 2019-06-27 15:37:37 -0500 | [diff] [blame] | 212 | |
| 213 | - name: Install jinja2 |
| 214 | pip: |
| 215 | name: jinja2 |
| 216 | state: present |
| 217 | become: true |
| 218 | when: ansible_architecture == 'x86_64' |