-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocal.yml
More file actions
293 lines (267 loc) · 9.44 KB
/
Copy pathlocal.yml
File metadata and controls
293 lines (267 loc) · 9.44 KB
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
- hosts: localhost
connection: local
become: true
pre_tasks:
- name: Update repositories
apt:
update_cache: yes
changed_when: False
tasks:
- name: Create ansible user
user:
name: ansible
system: yes
- name: Add ansible user to sudoers
copy:
src: files/sudoers_ansible
dest: /etc/sudoers.d/ansible
owner: root
group: root
mode: 0440
- name: Create cache directory
file:
path: /home/ansible/.cache
owner: ansible
group: ansible
state: directory
mode: '0755'
- name: Pull from repo every 15 minutes
cron:
user: ansible
name: "ansible provision"
minute: "*/15"
job: "/usr/bin/ansible-pull -o -U https://github.com/victoitor/pargo-lab-ansible-pull.git > /dev/null"
- name: Install packages
apt:
name:
- openssh-client
- openssh-server
- htop
- net-tools
- zsh
- curl
- build-essential
- cmake
- ninja-build
- meson
- pkg-config
- vim-gtk3
- 7zip
- fzf
- golang
- python3
- python3-pip
- python3-numpy
- python3-networkx
- python3-matplotlib
- python3-scipy
- python3-pandas
- python3-sphinx
- jupyter-notebook
- ipython3
- r-base
- r-cran-devtools
- r-cran-tidyverse
- r-cran-plotly
- clang
- rustc
- cargo
- lua5.4
- default-jdk
- lsb-base
- libqt5widgets5
- pandoc
- texlive-science
- texlive-publishers
- texlive-pictures
- texlive-games
- texlive-extra-utils
- texlive-bibtex-extra
- texlive-fonts-recommended
- texlive-lang-portuguese
- texlive-lang-english
- texlive-lang-spanish
- texlive-lang-french
- texlive-xetex
- texlive-luatex
- texlive-pstricks
- latexmk
- biber
- cb2bib
- postgresql
- graphviz
- dot2tex
- djvulibre-bin
- name: Install snap packages
block:
- name: Install normal snap packages
snap:
name:
- firefox
ignore_errors: true
- name: Install snap packages with --classic
snap:
name:
- nvim
classic: true
ignore_errors: true
- name: Install Flatpak
block:
- name: Install packages
apt:
name: flatpak
- name: Add Flathub remote
community.general.flatpak_remote:
name: flathub
state: present
flatpakrepo_url: https://dl.flathub.org/repo/flathub.flatpakrepo
- name: Install VSCode
apt:
deb: "https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64"
ignore_errors: true
- name: Install R-Studio
apt:
deb: "https://download1.rstudio.org/electron/jammy/amd64/rstudio-2024.04.0-735-amd64.deb"
ignore_errors: true
- name: Install github-cli
apt:
deb: "https://github.com/cli/cli/releases/download/v2.49.1/gh_2.49.1_linux_amd64.deb"
ignore_errors: true
- name: Install gitlab cli
apt:
deb: "https://gitlab.com/gitlab-org/cli/-/releases/v1.40.0/downloads/glab_1.40.0_Linux_x86_64.deb"
ignore_errors: true
- name: Install pgAdmin4
block:
- name: Install public key from repository
get_url:
url: https://www.pgadmin.org/static/packages_pgadmin_org.pub
dest: /usr/share/keyrings/packages-pgadmin-org.asc
checksum: sha256:546cbd50f8cadcf0832dc0aef9959b1ccf0b7e9a5e99c1518784bcc46f455585
register: pgAdmin_pkey
ignore_errors: true
- name: Add repository
apt_repository:
repo: "deb [signed-by=/usr/share/keyrings/packages-pgadmin-org.asc] https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/{{ ansible_distribution_release }} pgadmin4 main"
state: present
filename: pgadmin4.list
when: pgAdmin_pkey is not failed
- name: Install
apt:
name: pgadmin4
update_cache: yes
environment:
DEBIAN_FRONTEND: noninteractive
ignore_errors: true
- name: Install CPLEX
block:
- name: Get CPLEX installer
get_url:
url: https://pargo-13.local/files/cplex_studio2211.linux_x86_64.bin
dest: /home/ansible/.cache/cplex_studio2211.linux_x86_64.bin
mode: 0755
checksum: sha512:12662bbc6c82d2415ad9d542cd64626124ecb281173c42959d1d2c9ab81acf5e65ab316944d5103512f3367a1fd3187d97387e71855b1a3ae13a82ba26bdae47
validate_certs: false
register: cplex_dl
ignore_errors: true
- name: Install CPLEX
shell:
cmd: /home/ansible/.cache/cplex_studio2211.linux_x86_64.bin -DLICENSE_ACCEPTED=TRUE -DUSER_INSTALL_DIR=/opt/ibm/ILOG/CPLEX_Studio2211 -r /home/ansible/cplex_studio2211.log -i silent
when: cplex_dl is changed and cplex_dl is not failed
ignore_errors: true
register: cplex_install
- name: CPLEX post-installation
shell:
cmd: python /opt/ibm/ILOG/CPLEX_Studio2211/python/setup.py install
ignore_errors: true
when: cplex_install is changed and cplex_install is not failed
- name: Set Python3 as default python executable
community.general.alternatives:
name: python
path: /usr/bin/python3
link: /usr/local/bin/python
priority: 20
- name: Setup ParGO printer
block:
- name: Check if printer driver is installed
apt:
name: "{{ item }}"
state: present
check_mode: true
ignore_errors: true
loop:
- epson-inkjet-printer-escpr
- epsonscan2
- epsonscan2-non-free-plugin
register: epson_check
- name: Download Epson printer drivers
get_url:
url: "{{ item[0] }}"
dest: "/home/ansible/.cache/{{ item[1] }}"
checksum: "{{ item[2] }}"
loop:
- [ 'https://download3.ebz.epson.net/dsc/f/03/00/14/48/15/1d37501ad39bd2b5753a9cce3b2715b3e2fef557/epson-inkjet-printer-escpr_1.7.26-1lsb3.2_amd64.deb',
'epson-inkjet-printer-escpr_1.7.26-1lsb3.2_amd64.deb',
'sha512:583f1afddc6004471794e66a6b47e9ef328d98203a63dd0bd6ae0bbe3fcd2b93be0c906151d30406874da93b32b3c9da0c3562e02e6b08ef43fecba8d8aadd7e' ]
- [ 'https://download.ebz.epson.net/dsc/du/02/DriverDownloadInfo.do?LG2=JA&CN2=US&CTI=171&PRN=Linux%20deb%2064bit%20package&OSC=LX&DL',
'epsonscan2-bundle-6.7.61.0.x86_64.deb.tar.gz',
'sha512:ca703cbc38101f48679aa9cdcc2462b48b30a0bc5a66f671f37783975ddc531106427379dfa1aa8c2178a3b7c9a8be45b1b3d8b832b8aecd0eb87d0be0f58d82' ]
ignore_errors: true
register: epson_dl
when: epson_check is failed
- name: Extract scanner driver
unarchive:
src: /home/ansible/.cache/epsonscan2-bundle-6.7.61.0.x86_64.deb.tar.gz
dest: /home/ansible/.cache
owner: root
group: root
ignore_errors: true
when: epson_dl is changed and epson_dl is not failed
- name: Install Epson Printer drivers
apt:
deb: "/home/ansible/.cache/{{ item }}"
loop:
- epson-inkjet-printer-escpr_1.7.26-1lsb3.2_amd64.deb
- epsonscan2-bundle-6.7.61.0.x86_64.deb/core/epsonscan2_6.7.61.0-1_amd64.deb
- epsonscan2-bundle-6.7.61.0.x86_64.deb/plugins/epsonscan2-non-free-plugin_1.0.0.6-1_amd64.deb
ignore_errors: true
when: epson_dl is changed
- name: Check if Epson printer is already added
shell:
cmd: lpstat -v Pargo-L4260 2>&1
ignore_errors: true
register: lpstat_out
changed_when: False
- name: Configure Epson L4260 printer
shell:
cmd: lpadmin -p ParGO-L4260 -v "lpd://10.102.54.67:515/PASSTHRU" -m "lsb/usr/epson-inkjet-printer-escpr/Epson/Epson-L4260_Series-epson-inkjet-printer-escpr.ppd.gz"
when: lpstat_out.stdout.find('lpd://10.102.54.67:515/PASSTHRU') == -1
ignore_errors: true
- name: Add Epson Scanner script
copy:
src: files/add-epson-scanner
dest: /usr/local/bin/add-epson-scanner
owner: root
group: root
mode: 0755
- name: Add Epson Scanner on login (graphical)
copy:
src: files/epson-scanner.desktop
dest: /etc/xdg/autostart/epson-scanner.desktop
owner: root
group: root
mode: 0644
- name: Add cluster access configuration
copy:
src: files/bastion-cluster.conf
dest: /etc/ssh/ssh_config.d/bastion-cluster.conf
owner: root
group: root
mode: 0644
- name: Allow Printers passwordless configuration
copy:
src: files/49-allow-passwordless-printer.rules
dest: /etc/polkit-1/rules.d/49-allow-passwordless-printer-admin.rules
owner: root
group: root
mode: 0644