-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.yml
190 lines (162 loc) · 4.47 KB
/
setup.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
---
- name: Dev Setup
hosts: localhost
vars:
folders:
- go
- python
- js
- pemKeys
downloads:
url:
- https://deb.nodesource.com/setup_14.x
- https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh
- https://storage.googleapis.com/golang/getgo/installer_linux
- https://github.com/docker/compose/releases/download/1.27.4/docker-compose-Linux-x86_64
sudo_files:
- setup_14.x
- Anaconda3-2020.02-Linux-x86_64.sh
user_files:
- installer_linux
move_files:
- docker-compose-Linux-x86_64 /usr/local/bin/docker-compose
keys:
- https://packages.microsoft.com/keys/microsoft.asc
- https://download.docker.com/linux/debian/gpg
- https://www.pgadmin.org/static/packages_pgadmin_org.pub
- https://www.postgresql.org/media/keys/ACCC4CF8.asc
repos:
- deb [trusted=yes arch=amd64] https://download.docker.com/linux/debian {{ docker_version.stdout }} stable
- deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main
- deb http://apt.postgresql.org/pub/repos/apt/ {{ docker_version.stdout }}-pgdg main
- deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/{{ docker_version.stdout }} pgadmin4 main
packages:
- acl
- apt-transport-https
- apt-utils
- ca-certificates
- gnupg2
- software-properties-common
- libgl1-mesa-glx
- libegl1-mesa
- libxrandr2
- libxrandr2
- libxss1
- libxcursor1
- libxcomposite1
- libasound2
- libxi6
- libxtst6
- libpq-dev
- python3-dev
- python3-pip
- protobuf-compiler
- apt-transport-https
- rsync
- code
- nodejs
- postgresql-13
- docker-ce
- pgadmin4
node_lib:
- react
- react-scripts
- react-dom
go_get:
- go get github.com/lib/pq
- export
- GO111MODULE=on go get github.com/golang/protobuf/protoc-gen-go
- GO111MODULE=on go get -u google.golang.org/grpc
pip:
- psycopg2
git_config:
name:
- user.name
- user.email
- color.ui
value:
- cmelgreen
- true
tasks:
- name: make folders
file:
path: './{{ item }}'
mode: 0755
state: directory
with_items: '{{ folders }}'
- name: install rpm
apt:
name: rpm
state: latest
update_cache: yes
become: yes
- name: add keys
apt_key:
state: present
url: '{{ item }}'
with_items: '{{ keys }}'
become: yes
- name: save docker version to variable
shell: lsb_release -cs
register: docker_version
- name: add repositories
apt_repository:
repo: '{{ item }}'
state: present
with_items: '{{ repos }}'
become: yes
- name: download files
get_url:
url: '{{ item }}'
dest: .
mode: +x
with_items: '{{ downloads.url }}'
- name: run as root downloads
command: './{{ item }}'
with_items: '{{ downloads.sudo_files }}'
become: yes
- name: run as user downloads
command: './{{ item }}'
with_items: '{{ downloads.user_files }}'
- name: move files
command: 'mv {{ item }}'
with_items: '{{ downloads.move_files }}'
become: yes
- name: add source ./.bashrc to .profile
lineinfile:
path: ./.profile
line: 'source ./.bashrc'
- name: install packages
apt:
name: '{{ packages }}'
state: latest
update_cache: yes
become: yes
- name: set docker permissions
file:
path: /var/run/docker.sock
mode: 0666
become: yes
- name: install react
npm:
name: '{{ item }}'
global: yes
state: latest
with_items: '{{ node_lib }}'
become: yes
- name: go get some libraries
shell: '. ~/.bash_profile && {{ item }}'
args:
executable: /bin/bash
with_items: '{{ go_get }}'
- name: pip some stuff conda has a hard time with
pip:
name: '{{ pip }}'
- name: cleanup files
file:
path: '{{ item }}'
state: absent
with_flattened:
- '{{ downloads.sudo_files }}'
- '{{ downloads.user_files }}'