blob: 37ca313aaeb610afcefd1a1f1ba46376acd6714e [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 Wagantall7f93ce02018-08-09 19:41:49 -070061
62 - name: Install python-tox
63 apt:
64 name: python-tox
65 state: present
66 become: true
Jessica Wagantall42bf8272018-08-09 22:02:42 -070067
68 - apt_repository:
69 repo: ppa:jonathonf/python-3.6
70 state: present
71 become: true
72
73 - name: Update and upgrade apt packages
74 apt:
75 upgrade: yes
76 update_cache: yes
77 become: true
78
79 - name: Install Python 3.6 and packages
80 apt:
81 name:
82 - python3.6
83 - python3.6-dev
84 - libssl-dev
85 - libmysqlclient-dev
86 - gcc
87 become: true
Jessica Wagantall3fc37fe2018-08-10 00:16:16 -070088
89 - name: Install base packages
90 apt:
91 name:
92 - unzip
93 - xz-utils
94 - libxml-xpath-perl
95 - wget
96 - make
97 - npm
98 - sshuttle
99 - netcat
100 - libssl-dev
101 - libffi-dev
102 become: true
103
104 - name: Install autorelease support packages
105 apt:
106 name:
Jessica Wagantall3fc37fe2018-08-10 00:16:16 -0700107 - xmlstarlet
108 - xvfb
109 - crudini
110 - maven
111 - python-ncclient
112 become: true
Jessica Wagantall5db567b2018-08-16 20:26:42 -0700113
114 - name: Add Google Chrome key
115 apt_key:
116 url: https://dl-ssl.google.com/linux/linux_signing_key.pub
117 state: present
118 become: true
Jessica Wagantalle41a6872018-10-30 19:44:19 -0700119 when: "'x86_64' in ansible_architecture"
Jessica Wagantall5db567b2018-08-16 20:26:42 -0700120
121 - name: Add Google Chrome repo
122 copy: content="deb http://dl.google.com/linux/chrome/deb/ stable main" dest={{apt_file}} owner=root group=root mode=644
123 become: true
Jessica Wagantalle41a6872018-10-30 19:44:19 -0700124 when: "'x86_64' in ansible_architecture"
Jessica Wagantall5db567b2018-08-16 20:26:42 -0700125
126 - name: Update apt cache
127 apt: update_cache=yes
128 become: true
129
130 - name: Install Google Chrome
131 apt:
132 name: google-chrome-stable
133 state: present
134 become: true
Jessica Wagantalle41a6872018-10-30 19:44:19 -0700135 when: "'x86_64' in ansible_architecture"
Jessica Wagantallba4a03d2018-08-21 12:11:32 -0700136
Jessica Wagantall6e96b2e2018-08-21 14:38:37 -0700137 - name: Install Erlang dependency packages
138 apt:
139 name:
140 - libwxgtk3.0-0v5
141 - libsctp1
142 - libwxbase3.0-0v5
143 become: true
Jessica Wagantalle41a6872018-10-30 19:44:19 -0700144 when: "'x86_64' in ansible_architecture"
Jessica Wagantall6e96b2e2018-08-21 14:38:37 -0700145
146 - name: Install Erlang
147 apt:
148 deb: https://packages.erlang-solutions.com/erlang/esl-erlang/FLAVOUR_1_general/esl-erlang_19.3.6-1~ubuntu~trusty_amd64.deb
149 install_recommends: yes
150 become: true
Jessica Wagantalle41a6872018-10-30 19:44:19 -0700151 when: "'x86_64' in ansible_architecture"
Jessica Wagantall6e96b2e2018-08-21 14:38:37 -0700152
Jessica Wagantallba4a03d2018-08-21 12:11:32 -0700153 - name: Clone rebar3
154 git:
155 repo: 'https://github.com/erlang/rebar3.git'
156 dest: /tmp/rebar3
Jessica Wagantalle41a6872018-10-30 19:44:19 -0700157 when: "'x86_64' in ansible_architecture"
Jessica Wagantallba4a03d2018-08-21 12:11:32 -0700158
159 - name: Bootstrap rebar3
160 command: ./bootstrap
161 args:
162 chdir: /tmp/rebar3
Jessica Wagantalle41a6872018-10-30 19:44:19 -0700163 when: "'x86_64' in ansible_architecture"
Jessica Wagantallba4a03d2018-08-21 12:11:32 -0700164
Jessica Wagantall79c77662018-08-21 14:16:28 -0700165 - name: Install rebar3 to bin
166 copy:
167 src: /tmp/rebar3/rebar3
168 dest: /usr/bin/rebar3
Jessica Wagantallb4cf59a2018-08-24 12:17:49 -0700169 mode: 0755
Jessica Wagantall79c77662018-08-21 14:16:28 -0700170 remote_src: true
Jessica Wagantall58744aa2018-08-21 17:48:03 -0700171 become: true
Jessica Wagantalle41a6872018-10-30 19:44:19 -0700172 when: "'x86_64' in ansible_architecture"
Jessica Wagantallba4a03d2018-08-21 12:11:32 -0700173
174 - name: Remove unused rebar3 source
175 file:
176 path: /tmp/rebar3
177 state: absent
Jessica Wagantalle41a6872018-10-30 19:44:19 -0700178 when: "'x86_64' in ansible_architecture"
Jessica Wagantall49f835a2018-08-23 15:08:54 -0700179
180 - name: Download geckodriver
181 unarchive:
182 src: https://github.com/mozilla/geckodriver/releases/download/v0.18.0/geckodriver-v0.18.0-linux64.tar.gz
183 dest: /usr/bin
Jessica Wagantallb4cf59a2018-08-24 12:17:49 -0700184 mode: 0755
Jessica Wagantall49f835a2018-08-23 15:08:54 -0700185 remote_src: yes
186 become: true
Jessica Wagantalle41a6872018-10-30 19:44:19 -0700187 when: "'x86_64' in ansible_architecture"
Jessica Wagantallc944ef02018-08-30 17:53:11 -0700188
189 - name: Download Firefox version 55.0.3
190 unarchive:
191 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 -0700192 dest: /opt
Jessica Wagantallc944ef02018-08-30 17:53:11 -0700193 mode: 0755
194 remote_src: yes
Jessica Wagantalle41a6872018-10-30 19:44:19 -0700195 when: "'x86_64' in ansible_architecture"
Jessica Wagantallc944ef02018-08-30 17:53:11 -0700196 become: true
197
198 - name: Create symbolic link to firefox bin
199 file:
Jessica Wagantallbbdb4d62018-09-24 18:21:48 -0700200 src: "/opt/firefox/firefox"
Jessica Wagantallc944ef02018-08-30 17:53:11 -0700201 dest: "/usr/bin/firefox"
202 state: link
Jessica Wagantalle41a6872018-10-30 19:44:19 -0700203 when: "'x86_64' in ansible_architecture"
Jessica Wagantallc944ef02018-08-30 17:53:11 -0700204 become: true