-
Notifications
You must be signed in to change notification settings - Fork 1
/
playbook.yaml
864 lines (814 loc) · 31.3 KB
/
playbook.yaml
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
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
---
# List of plays
-
# Hosts: where our play will run and options it will run with
hosts: localhost
connection: local
gather_facts: yes
tags: always
# Vars: variables that will apply to the play, on all targets
# Tasks: the list of tasks that will be executed within
# the play, this section can also be used for
# pre and post tasks
tasks:
# from https://superuser.com/questions/1395954/ansible-playbook-to-determine-os-release
- name: System details
debug: msg="{{ item }}"
with_items:
- "{{ ansible_distribution }}"
- "{{ ansible_distribution_version }}"
- "{{ ansible_distribution_major_version }}"
- name: Verify install_files is present
debug: msg="install_files/_README = {{ lookup('file', '/home/kasm-default-profile/install_files/_README') }}"
# Detect if we are running on a WSL2 environment
- name: Verify install_files is present
debug: msg="install_files/_README = {{ lookup('file', '/home/kasm-default-profile/install_files/_README') }}"
# Detect if we are running on a WSL2 environment
- name: Set wsl2_environment fact default to false
set_fact:
wsl2_environment: false
- name: Set wsl2_environment fact True
set_fact:
wsl2_environment: true
when: ansible_kernel is search("microsoft-standard-WSL2")
# fix for .gnupg/ permissions when building custom images
- name: Add fix for .gnupg/ permissions
lineinfile:
path: "/etc/bash.bashrc"
line: "chmod 700 ~/.gnupg/"
- name: Add custom prompt to /etc/skel/.profile
lineinfile:
path: "/etc/skel/.profile"
line: 'export PS1="\[\033[00;32m\][\w]\$\[\033[00m\] "'
- name: Get disk usage
shell: df -h
register: disk_usage
- name: Display disk usage
debug:
msg: "{{ disk_usage.stdout }}"
# Handlers: the list of handlers that are executed as a notify
# key from a task
# Roles: list of roles to be imported into the play
roles:
- role: irixjp.role_example_hello
# Add additional plays here (remember the list entry -)
# Be sure to use the same hosts and connection entries above
# addtional plays
-
# Install build-essential
hosts: localhost
connection: local
tags:
- install_plantuml
- install_generator_asciidoctor
- install_doctools
tasks:
- name: Install build-essential
apt:
name: build-essential
update_cache: yes
- name: Get disk usage
shell: df -h
register: disk_usage
- name: Display disk usage
debug:
msg: "{{ disk_usage.stdout }}"
-
# install firefox
hosts: localhost
connection: local
gather_facts: yes
tags:
- install_firefox
vars:
firefox_profiles:
default:
extensions:
- ublock-origin
preferences:
network.cookie.cookieBehavior: 1
privacy.donottrackheader.enabled: true
datareporting.healthreport.uploadEnabled: false
secondprofile:
extensions:
- adblock-plus
preferences:
privacy.donottrackheader.enabled: false
privacy.trackingprotection.enabled: false
signon.rememberSignons: false
datareporting.healthreport.uploadEnabled: false
tasks:
- name: Get disk usage
shell: df -h
register: disk_usage
- name: Display disk usage
debug:
msg: "{{ disk_usage.stdout }}"
pre_tasks:
- name: Update apt packages
apt:
update_cache: yes
roles:
- role: staticdev.firefox
-
# install keychain, git, and @capsulecorplab .vimrc and .gitconfig
hosts: localhost
connection: local
gather_facts: yes
tags:
- install_utilities
- install_fprime
- install_pharo
vars:
git_version: "2.34.1"
git_version_to_install: "1:{{ git_version }}-0ppa1~ubuntu22.04.1"
keychain_version: "2.8.5"
keychain_version_to_install: "{{ keychain_version }}-2"
keychain_version_expected: "{{ keychain_version }}.."
tasks:
- name: Install unzip
apt:
name: unzip
update_cache: yes
- name: Add git PPA
shell: add-apt-repository ppa:git-core/ppa
- name: Install git
apt:
name: git
- name: Install Git Bash Completion
apt:
name: bash-completion
update_cache: yes
- name: Install Keychain
apt:
name: "keychain={{ keychain_version_to_install }}"
update_cache: yes
- name: install ping
apt:
name: iputils-ping
update_cache: yes
- name: Get git version
shell: git version | sed 's/[[:alpha:]|(|[:space:]]//g'
register: installed_git_version
- name: Get keychain version
shell:
cmd: keychain -V 2> >(grep -i keychain) 2> >(sed 's/[[:alpha:]|(|[:space:]]//g') | fgrep '*' | sed 's/[*~://]//g'
executable: /bin/bash
register: installed_keychain_version
- name: Display git and keychain versions
debug:
msg: "git = {{ installed_git_version.stdout }} | keychain = {{ installed_keychain_version.stdout }}"
- name: Test git version
fail:
msg: "Git Version Error: Expected {{ git_version }} | Found {{ installed_git_version.stdout }}"
when: installed_git_version.stdout != git_version
- name: Test keychain version
fail:
msg: "Keychain Version Error: Expected {{ keychain_version_expected }} | Found {{ installed_keychain_version.stdout }}"
when: installed_keychain_version.stdout != keychain_version_expected
- name: auto-launch keychain in shell, if ssh keys exists
shell: echo 'if [ -r ~/.ssh/id_ed25519 ]; then\n eval `keychain --eval id_ed25519`\nfi' >> /home/kasm-default-profile/.bashrc
- name: Install @capsulecorplab .vimrc
get_url:
url: https://gist.githubusercontent.com/capsulecorplab/495058e7a57ed8adaed3c40c80d09739/raw/4a6e6f6ff92b96919be111c9cbb5a4a21ab472d2/.vimrc
dest: /home/kasm-default-profile/
- name: Install @capsulecorplab .gitconfig
get_url:
url: https://gist.githubusercontent.com/capsulecorplab/401ba2fe0857a328f2a626adbf078cc6/raw/b89a6234f0d620ff60bcfe37f95de197b8772377/.gitconfig
dest: /home/kasm-default-profile/
- name: Get disk usage
shell: df -h
register: disk_usage
- name: Display disk usage
debug:
msg: "{{ disk_usage.stdout }}"
-
# Install NodeJS Tools
hosts: localhost
connection: local
gather_facts: yes
tags:
- install_node
- install_doctools
vars:
node_version: "20.11.1"
v_node_version: "v{{ node_version }}"
npm_version: "10.2.4"
npx_version: "10.2.4"
yarn_version: "3.5.0"
yo_version: "4.3.1"
generator_code_version: "1.7.5"
oclif_version: "4.3.6"
typescript_version: "5.1.3"
cli_njk_version: "1.0.0"
ungit_version: "1.5.25"
tasks: # Test Node JS Tools versions
- name: Install Yarn
shell: "corepack enable && corepack prepare yarn@{{ yarn_version }} --activate"
- name: Get node version
shell: node --version
register: installed_node_version
- name: Get npm version
shell: npm --version
register: installed_npm_version
- name: Get npx installed version
shell: npx --version
register: installed_npx_version
- name: Get yarn version
shell: yarn --version
register: installed_yarn_version
- name: Get oclif version
shell: oclif --version 2>/dev/null | sed 's/\ /\n/g' | grep oclif | sed 's/\///g' | sed 's/[[:alpha:]|(|[:space:]]//g'
register: installed_oclif_version
- name: Get TypeScript Compiler version
shell: tsc --version | sed 's/[[:alpha:]|(|[:space:]]//g'
register: installed_tsc_version
- name: Get cli-njk version
shell: njk --version
register: installed_cli_njk_version
- name: Get ungit version
shell: ungit --version | sed 's/+/ /g' | awk '{print $1'}
register: installed_ungit_version
- name: Display node tool versions
debug:
msg: "Node = {{ installed_node_version.stdout }} | npm = {{ installed_npm_version.stdout }} | npx = {{ installed_npx_version.stdout }} | yarn = {{ installed_yarn_version.stdout }}"
- name: Display TypeScript Compiler version
debug:
msg: "tsc = {{ installed_tsc_version.stdout }}"
- name: Display cli-njk version
debug:
msg: "cli-njk = {{ installed_cli_njk_version.stdout }}"
- name: Display ungit version
debug:
msg: "ungit = {{ installed_ungit_version.stdout }}"
- name: Test node version
fail:
msg: "NodeJS Version Error: Expected {{ v_node_version }} | Found {{ installed_node_version.stdout }}"
when: installed_node_version.stdout != v_node_version
- name: Test npm version
fail:
msg: "NPM Version Error: Expected {{ npm_version }} | Found {{ installed_npm_version.stdout }}"
when: installed_npm_version.stdout != npm_version
- name: Test npx version
fail:
msg: "NPX Version Error: Expected {{ npx_version }} | Found {{ installed_npx_version.stdout }}"
when: installed_npx_version.stdout != npx_version
- name: Test yarn version
fail:
msg: "Yarn Version Error: Expected {{ yarn_version }} | Found {{ installed_yarn_version.stdout }}"
when: installed_yarn_version.stdout != yarn_version
- name: Test oclif version
fail:
msg: "oclif Version Error: Expected {{ oclif_version }} | Found {{ installed_oclif_version.stdout }}"
when: installed_oclif_version.stdout != oclif_version
when: installed_yarn_version.stdout != yarn_version
- name: Test TypeScript Compiler version
fail:
msg: "TypeScript Compiler Version Error: Expected {{ typescript_version }} | Found {{ installed_tsc_version.stdout }}"
when: installed_tsc_version.stdout != typescript_version
- name: Test cli-njk version
fail:
msg: "cli-njk Version Error: Expected {{ cli_njk_version }} | Found {{ installed_cli_njk_version.stdout }}"
when: installed_cli_njk_version.stdout != cli_njk_version
- name: Test ungit version
fail:
msg: "ungit Version Error: Expected {{ ungit_version }} | Found {{ installed_ungit_version.stdout }}"
when: installed_ungit_version.stdout != ungit_version
roles:
- role: grzegorznowak.nvm_node
nvm_install_script_version: "0.39.3"
nvm_node_version: "{{ node_version }}"
nvm_install_globally:
- name: yo
version: "{{ yo_version }}"
- name: generator-code
version: "{{ generator_code_version }}"
- name: oclif
version: "{{ oclif_version }}"
- name: typescript
version: "{{ typescript_version }}"
- name: cli-njk
version: "{{ cli_njk_version }}"
- name: ungit
version: "{{ ungit_version }}"
-
# install fprime tools
hosts: localhost
connection: local
gather_facts: yes
tags:
- install_fprime
vars:
fprime_workspace_image_version: v3.4.0-1.1.0
tasks:
- name: Get ansible version (in ansible)
shell:
cmd: ansible --version
executable: /bin/bash
register: installed_ansible_version
- name: Get ansible-playbook version (in ansible)
shell:
cmd: ansible-playbook --version
executable: /bin/bash
register: installed_ansible_playbook_version
- name: Display ansible version
debug:
msg: ansible = {{ installed_ansible_version.stdout }}
- name: Display ansible-playbook version
debug:
msg: ansible = {{ installed_ansible_playbook_version.stdout }}
- name: Clone fprime-workspace-image
shell:
cmd: git clone https://github.com/fprime-community/fprime-workspace-image.git
chdir: /home/kasm-default-profile/install_files
executable: /bin/bash
- name: Checkout {{ fprime_workspace_image_version }} in fprime-workspace-image repo
shell:
cmd: git checkout {{ fprime_workspace_image_version }}
chdir: /home/kasm-default-profile/install_files/fprime-workspace-image
executable: /bin/bash
- name: Copy contents of fprime-workspace-image/install_files into install_files
shell:
cmd: cp -rf fprime-workspace-image/install_files/* .
chdir: /home/kasm-default-profile/install_files
executable: /bin/bash
- name: Install fprime tools with ansible-galaxy
shell:
cmd: ansible-galaxy install -r requirements.yaml && ansible-playbook -i,localhost playbook.yaml --tags "install_fprime_tools" && rm -f ./*.yaml
chdir: /home/kasm-default-profile/install_files/fprime-workspace-image
executable: /bin/bash
- name: Get disk usage
shell: df -h
register: disk_usage
- name: Display disk usage
debug:
msg: "{{ disk_usage.stdout }}"
-
# install PrusaSlicer
hosts: localhost
connection: local
gather_facts: yes
tags:
- install_oshw_tools
- install_prusaslicer
vars:
prusaslicer_version: 2.7.0
prusaslicer_release_date: 202311231454
prusaslicer_dir: "PrusaSlicer-{{ prusaslicer_version }}+linux-x64-GTK3-{{ prusaslicer_release_date }}"
tasks:
- name: Join parts of PrusaSlicer tarball
shell: cat /home/kasm-default-profile/install_files/{{ prusaslicer_dir }}.tar.bz2.parta* > /home/kasm-default-profile/install_files/{{ prusaslicer_dir }}.tar.bz2
- name: Extract PrusaSlicer for 64-bit Linux to /opt
unarchive:
src: /home/kasm-default-profile/install_files/{{ prusaslicer_dir }}.tar.bz2
dest: /opt
remote_src: yes
creates: /opt/{{ prusaslicer_dir }}/bin/prusa-slicer
- name: Create symlink for prusa-slicer in /usr/local/bin
shell: ln -srv /opt/{{ prusaslicer_dir }}/bin/prusa-slicer /usr/local/bin/prusa-slicer
- name: Configure PrusaSlicer desktop shortcut
shell: echo "[Desktop Entry]\nName=PrusaSlicer\nGenericName=PrusaSlicer\nExec=/usr/local/bin/prusa-slicer\nIcon=/opt/{{ prusaslicer_dir }}/resources/icons/PrusaSlicer.png\nTerminal=false\nType=Application\nStartupNotify=false\nCategories=Application;Development;" > /usr/share/applications/prusaslicer.desktop
- name: Get prusa-slicer version
shell: prusa-slicer --help | grep PrusaSlicer- | awk '{ print $1 '}
register: installed_prusaslicer_version
- name: Display prusa-slicer version
debug:
msg: "prusa-slicer = {{ installed_prusaslicer_version.stdout }}"
- name: Test prusa-slicer version
fail:
msg: "prusa-slicer Error: Expected {{ prusaslicer_dir }} | Found {{ installed_prusaslicer_version.stdout }}"
when: installed_prusaslicer_version.stdout != prusaslicer_dir
- name: Get disk usage
shell: df -h
register: disk_usage
- name: Display disk usage
debug:
msg: "{{ disk_usage.stdout }}"
-
# install OpenSCAD
hosts: localhost
connection: local
gather_facts: yes
tags:
- install_oshw_tools
- install_openscad
vars:
openscad_version: "2021.01"
openscad_version_to_install: "{{ openscad_version }}-4build1"
tasks:
- name: Install openscad
apt:
name: "openscad={{ openscad_version_to_install }}"
- name: Get OpenSCAD version
shell: openscad --info | grep 'OpenSCAD Version' | awk '{ print $3 '}
register: installed_openscad_version
- name: Display OpenSCAD version
debug:
msg: "OpenSCAD = {{ installed_openscad_version.stdout }}"
- name: Test OpenSCAD version
fail:
msg: "OpenSCAD Version Error: Expected {{ openscad_version }} | Found {{ installed_openscad_version.stdout }}"
when: installed_openscad_version.stdout != openscad_version
- name: Get disk usage
shell: df -h
register: disk_usage
- name: Display disk usage
debug:
msg: "{{ disk_usage.stdout }}"
-
# install Python packages with pip
hosts: localhost
connection: local
gather_facts: yes
tasks:
- name: Update OS to point python to python3
apt:
name: python-is-python3
update_cache: yes
- name: Install pip for python3 with Apt
apt:
name: python3-pip
update_cache: yes
- name: Install python packages with pip
pip:
name:
- jupyterlab
- notebook
- voila
- pint
- name: Get disk usage
shell: df -h
register: disk_usage
- name: Display disk usage
debug:
msg: "{{ disk_usage.stdout }}"
-
# install ASCII Doctor
hosts: localhost
connection: local
gather_facts: yes
tags:
- install_generator_asciidoctor
- install_doctools
vars:
asciidoctor_version: 2.0.17
asciidoctor_version_expected: "{{ asciidoctor_version }}[.]"
tasks:
- name: Install Ruby
apt:
name: ruby-full
update_cache: yes
- name: Run gem install for asciidoctor
shell:
cmd: "gem install asciidoctor -v {{ asciidoctor_version }}"
- name: Install hexapdf dependencies
apt:
name: libssl-dev
update_cache: yes
- name: Install PlantUML and PDF support
shell:
cmd: gem install asciidoctor-diagram rghost hexapdf text-hyphen rouge pygments.rb coderay asciidoctor-pdf
- name: Get asciidoctor version
shell: asciidoctor --version | grep Asciidoctor | sed 's/[[:alpha:]|(|[:space:]]//g' | sed 's/[*~://]//g'
register: installed_asciidoctor_version
- name: Display asciidoctor version
debug:
msg: "ASCII Doctor = {{ installed_asciidoctor_version.stdout }}"
- name: Test asciidoctor version
fail:
msg: "ASCII Doctor Version Error: Expected {{ asciidoctor_version_expected }} | Found {{ installed_asciidoctor_version.stdout }}"
when: installed_asciidoctor_version.stdout != asciidoctor_version_expected
- name: Get disk usage
shell: df -h
register: disk_usage
- name: Display disk usage
debug:
msg: "{{ disk_usage.stdout }}"
-
# install QOwnNotes
hosts: localhost
connection: local
tags:
- install_doctools
vars:
qownnotes_version: "23.12.5"
tasks:
- name: Install QMake tools
apt:
name: qt5-qmake, libqt5websockets5-dev, libqt5svg5*, qtdeclarative5-dev, libqt5x11extras5-dev
update_cache: yes
- name: Expand source files archive
unarchive:
src: /home/kasm-default-profile/install_files/qownnotes-{{ qownnotes_version }}.tar.xz
dest: /home/kasm-default-profile/install_files/
remote_src: yes
creates: /home/kasm-default-profile/install_files/qownnotes-{{ qownnotes_version }}/LICENSE
- name: Build QOwnNotes # as per https://www.qownnotes.org/installation/building.html
shell:
cmd: qmake && make
chdir: /home/kasm-default-profile/install_files/qownnotes-{{ qownnotes_version }}
executable: /bin/bash
- name: Get disk usage
shell: df -h
register: disk_usage
- name: Display disk usage
debug:
msg: "{{ disk_usage.stdout }}"
-
# Install Pharo
hosts: localhost
connection: local
tags:
- install_pharo
vars:
pharo_launcher_version: "c661cf8e517bf2695fb637aa058d7fab3449107a"
pharo_version: "11"
roassal_version: "v1.01b"
roassalexporter_version: "v1.0"
neocsv_version: "fcffa0bba57b2c8c4624eb356fd29afc9b3dbf4a"
xmlparser_version: "531f9b7c711c89e51ac54cb878099f5a89bca50e"
tasks:
- name: Clone PharoLauncher
shell:
cmd: git clone https://github.com/pharo-project/pharo-launcher.git
chdir: /home/kasm-default-profile
executable: /bin/bash
- name: Checkout {{ pharo_launcher_version }} in pharo-launcher repo
shell:
cmd: git checkout {{ pharo_launcher_version }}
chdir: /home/kasm-default-profile/pharo-launcher
executable: /bin/bash
- name: Download Pharo {{ pharo_version }} image + vm in pharo-launcher
shell:
cmd: curl https://get.pharo.org/{{ pharo_version }}0+vm | bash
chdir: /home/kasm-default-profile/pharo-launcher
executable: /bin/bash
- name: Rename Pharo.image to PharoLauncher.image
shell:
cmd: mv Pharo.image PharoLauncher.image
chdir: /home/kasm-default-profile/pharo-launcher
executable: /bin/bash
- name: Load PharoLauncher with Metachello from shell # as per https://github.com/pharo-project/pharo-launcher/blob/feature/cmd-line/build.sh#L31C2-L31C183
shell:
cmd: ./pharo PharoLauncher.image eval --save "Metacello new baseline{{ ':' }} 'PharoLauncher'; repository{{ ':' }} 'gitlocal{{ ':' }}//src'; ignoreImage; onConflictUseIncoming; onWarning{{ ':' }} [{{ ':' }}ex | ex load]; load"
chdir: /home/kasm-default-profile/pharo-launcher
executable: /bin/bash
- name: Enable PharoDarkTheme in PharoLauncher
shell:
cmd: ./pharo PharoLauncher.image eval --save "PharoDarkTheme beCurrent"
chdir: /home/kasm-default-profile/pharo-launcher
executable: /bin/bash
- name: Configure pharo-launcher bash script
shell: echo "#!/usr/bin/env bash\n/home/kasm-default-profile/pharo-launcher/pharo-ui /home/kasm-default-profile/pharo-launcher/PharoLauncher.image eval 'PharoLauncherApplication openFull'" > /home/kasm-default-profile/install_files/pharo-launcher
- name: Copy pharo-launcher bash script into /home/kasm-default-profile/pharo-launcher and set to executable
copy:
src: /home/kasm-default-profile/install_files/pharo-launcher
dest: /home/kasm-default-profile/pharo-launcher
remote_src: yes
owner: root
group: root
mode: a+x
- name: Create symlink for pharo-launcher in /usr/local/bin
shell: ln -sv /home/kasm-default-profile/pharo-launcher/pharo-launcher /usr/local/bin/pharo-launcher
- name: Configure PharoLauncher desktop shortcut
shell: echo "[Desktop Entry]\nName=Pharo\nGenericName=Pharo\nExec=pharo-launcher\nIcon=/home/kasm-default-profile/pharo-launcher/icons/pharo-launcher.png\nTerminal=false\nType=Application\nStartupNotify=false\nCategories=Application;Development;" > /usr/share/applications/pharo.desktop
- name: Create RoassalPlayground (pharo image) using PharoLaucher-CLI
shell:
cmd: ./pharo PharoLauncher.image clap launcher image create fromRepo --newImageName RoassalPlayground pharo-graphics/Roassal
chdir: /home/kasm-default-profile/pharo-launcher
executable: /bin/bash
- name: Change remote origin to https://github.com/ObjectProfile/Roassal3.git
shell:
cmd: git remote set-url origin https://github.com/ObjectProfile/Roassal3.git
chdir: /home/kasm-default-profile/Pharo/images/RoassalPlayground/pharo-local/iceberg/pharo-graphics/Roassal
- name: Fetch upstream in Roassal repo
shell:
cmd: git fetch
chdir: /home/kasm-default-profile/Pharo/images/RoassalPlayground/pharo-local/iceberg/pharo-graphics/Roassal
- name: Checkout {{ roassal_version }} in Roassal repo
shell:
cmd: git checkout {{ roassal_version }}
chdir: /home/kasm-default-profile/Pharo/images/RoassalPlayground/pharo-local/iceberg/pharo-graphics/Roassal
executable: /bin/bash
- name: Download Pharo {{ pharo_version }} image + vm into RoassalPlayground
shell:
cmd: curl https://get.pharo.org/{{ pharo_version }}0+vm | bash
chdir: /home/kasm-default-profile/Pharo/images/RoassalPlayground
executable: /bin/bash
- name: Rename Pharo.changes to RoassalPlayground.changes
shell:
cmd: mv Pharo.changes RoassalPlayground.changes
chdir: /home/kasm-default-profile/Pharo/images/RoassalPlayground
executable: /bin/bash
- name: Rename Pharo.image to RoassalPlayground.image
shell:
cmd: mv Pharo.image RoassalPlayground.image
chdir: /home/kasm-default-profile/Pharo/images/RoassalPlayground
executable: /bin/bash
- name: Enable PharoDarkTheme in RoassalPlayground
shell:
cmd: ./pharo RoassalPlayground.image eval --save "PharoDarkTheme beCurrent"
chdir: /home/kasm-default-profile/Pharo/images/RoassalPlayground
executable: /bin/bash
- name: Load Full Roassal3 package from local repo into RoassalPlayground using Metacello
shell:
cmd: ./pharo RoassalPlayground.image eval --save "[Metacello new baseline{{ ':' }} 'Roassal3'; repository{{ ':' }} 'gitlocal{{ ':' }}//./pharo-local/iceberg/pharo-graphics/Roassal/src'; load{{ ':' }} 'Full'] on{{ ':' }} MCMergeOrLoadWarning do{{ ':' }} [:warning | warning load ]"
chdir: /home/kasm-default-profile/Pharo/images/RoassalPlayground
executable: /bin/bash
- name: Create directory for svenvc/NeoCSV in RoassalPlayground/pharo-local/iceberg
shell:
cmd: mkdir svenvc
chdir: /home/kasm-default-profile/Pharo/images/RoassalPlayground/pharo-local/iceberg/
- name: Clone NeoCSV into RoassalPlayground/pharo-local/iceberg/svenvc
shell:
cmd: git clone https://github.com/svenvc/NeoCSV.git
chdir: /home/kasm-default-profile/Pharo/images/RoassalPlayground/pharo-local/iceberg/svenvc
- name: Checkout {{ neocsv_version }} in NeoCSV repo
shell:
cmd: git checkout {{ neocsv_version }}
chdir: /home/kasm-default-profile/Pharo/images/RoassalPlayground/pharo-local/iceberg/svenvc/NeoCSV
executable: /bin/bash
- name: Load NeoCSV package from local repo into RoassalPlayground using Metacello
shell:
cmd: ./pharo RoassalPlayground.image eval --save "[Metacello new baseline{{ ':' }} 'NeoCSV'; repository{{ ':' }} 'gitlocal{{ ':' }}//./pharo-local/iceberg/svenvc/NeoCSV/repository'; load] on{{ ':' }} MCMergeOrLoadWarning do{{ ':' }} [:warning | warning load ]"
chdir: /home/kasm-default-profile/Pharo/images/RoassalPlayground
executable: /bin/bash
- name: Clone XML-XMLParser into RoassalPlayground/pharo-local/iceberg/pharo-contributions
shell:
cmd: git clone https://github.com/pharo-contributions/XML-XMLParser.git
chdir: /home/kasm-default-profile/Pharo/images/RoassalPlayground/pharo-local/iceberg/pharo-contributions
- name: Checkout {{ xmlparser_version }} in NeoCSV repo
shell:
cmd: git checkout {{ xmlparser_version }}
chdir: /home/kasm-default-profile/Pharo/images/RoassalPlayground/pharo-local/iceberg/pharo-contributions/XML-XMLParser
executable: /bin/bash
- name: Load XMLParser package from local repo into RoassalPlayground using Metacello
shell:
cmd: ./pharo RoassalPlayground.image eval --save "[Metacello new baseline{{ ':' }} 'XMLParser'; repository{{ ':' }} 'gitlocal{{ ':' }}//./pharo-local/iceberg/pharo-contributions/XML-XMLParser/src'; load] on{{ ':' }} MCMergeOrLoadWarning do{{ ':' }} [:warning | warning load ]"
chdir: /home/kasm-default-profile/Pharo/images/RoassalPlayground
executable: /bin/bash
- name: Clone Roassal3Exporters into RoassalPlayground/pharo-local/iceberg/pharo-contributions
shell:
cmd: git clone https://github.com/ObjectProfile/Roassal3Exporters
chdir: /home/kasm-default-profile/Pharo/images/RoassalPlayground/pharo-local/iceberg/pharo-contributions
- name: Checkout {{ roassalexporter_version }} in Roassal3Exporters repo
shell:
cmd: git checkout {{ roassalexporter_version }}
chdir: /home/kasm-default-profile/Pharo/images/RoassalPlayground/pharo-local/iceberg/pharo-contributions/Roassal3Exporters
executable: /bin/bash
- name: Load Roassal3Exporters package from local repo into RoassalPlayground using Metacello
shell:
cmd: ./pharo RoassalPlayground.image eval --save "[Metacello new baseline{{ ':' }} 'Roassal3Exporters'; repository{{ ':' }} 'gitlocal{{ ':' }}//./pharo-local/iceberg/pharo-contributions/Roassal3Exporters/src'; load] on{{ ':' }} MCMergeOrLoadWarning do{{ ':' }} [:warning | warning load ]"
chdir: /home/kasm-default-profile/Pharo/images/RoassalPlayground
executable: /bin/bash
- name: Get disk usage
shell: df -h
register: disk_usage
- name: Display disk usage
debug:
msg: "{{ disk_usage.stdout }}"
-
# install sudo for the vs-code role below
hosts: localhost
connection: local
tasks:
- name: Install Sudo
apt:
name: sudo
update_cache: yes
- name: Preserve DONT_PROMPT_WSL_INSTALL in sudoers
lineinfile:
path: "/etc/sudoers"
line: "Defaults env_keep += \"DONT_PROMPT_WSL_INSTALL\""
when: wsl2_environment
- name: Get disk usage
shell: df -h
register: disk_usage
- name: Display disk usage
debug:
msg: "{{ disk_usage.stdout }}"
-
# add dev user to give vs code somewhere to install extensions
hosts: localhost
connection: local
tasks:
- name: Add dev user
user:
name: dev
uid: 1001
- name: Get disk usage
shell: df -h
register: disk_usage
- name: Display disk usage
debug:
msg: "{{ disk_usage.stdout }}"
-
# install the remainder of the tools
hosts: localhost
connection: local
environment:
DONT_PROMPT_WSL_INSTALL: 1
roles:
- role: gantsign.visual-studio-code
users:
- username: "dev"
visual_studio_code_extensions:
- ms-python.python
- dendron.dendron
visual_studio_code_settings_overwrite: yes
visual_studio_code_settings: {
"extensions.ignoreRecommendations": true,
"update.mode": "none",
"extensions.autoUpdate": false,
"extensions.autoCheckUpdates": false,
"terminal.integrated.profiles.linux": {
"bash (login)": {
"path": "bash",
"args": ["-l"]
}
},
"terminal.integrated.defaultProfile.linux": "bash (login)"
}
tasks:
- name: Get disk usage
shell: df -h
register: disk_usage
- name: Display disk usage
debug:
msg: "{{ disk_usage.stdout }}"
-
# install PlantUML
hosts: localhost
connection: local
gather_facts: yes
tags:
- install_plantuml
- install_doctools
vars:
jdk_version: 2:1.11-72build2
graphviz_version_expected: "dot - graphviz version 2.50.0 (20211204.2007)"
tasks:
- name: Install JDK
apt:
name: "default-jdk={{ jdk_version }}"
update_cache: yes
- name: Get JDK Version
shell: java --version | grep -m 1 -i openjdk
register: installed_jdk_version
- name: Install pre-reqs to build graphviz
apt:
name: libcairo2-dev, libexpat-dev, libfreetype-dev, libgd-dev, fontconfig-config, libglib2.0-dev, libgtk2.0-dev, libpng-dev, zlib1g-dev, libsdl-pango-dev, libgts-bin, libgtk-3-dev, libgtkglext1-dev, glade, freeglut3-dev, autoconf, automake, bison, flex, ghostscript, libtool, pkg-config, swig
update_cache: yes
- name: Expand source files archive
unarchive:
src: /home/kasm-default-profile/install_files/graphviz-2.50.0.tar.gz
dest: /home/kasm-default-profile/install_files/
remote_src: yes
creates: /home/kasm-default-profile/install_files/graphviz-2.50.0/README
- name: Build graphviz
shell:
cmd: ./configure --enable-perl=no && make > /tmp/graphviz_build_output.txt 2>&1 && make install
chdir: /home/kasm-default-profile/install_files/graphviz-2.50.0/
executable: /bin/bash
- name: Get graphviz version
shell: dot -V
register: installed_graphviz_version
- name: install plantuml
copy:
src: /home/kasm-default-profile/install_files/plantuml.jar
dest: /usr/local/bin/plantuml.jar
remote_src: yes
- name: Display JDK and GraphViz versions
debug:
msg: "JDK = {{ installed_jdk_version.stdout }} | graphviz = {{ installed_graphviz_version.stderr }}"
- name: Test Graphviz version
fail:
msg: "Graphviz Version Error: Expected {{ graphviz_version_expected }} | Found {{ installed_graphviz_version.stderr }}"
when: installed_graphviz_version.stderr != graphviz_version_expected
- name: Get disk usage
shell: df -h
register: disk_usage
- name: Display disk usage
debug:
msg: "{{ disk_usage.stdout }}"
-
# Copy VS Code changes to kasm-default-profile and lean up (remove) dev user now that vs code is installed
hosts: localhost
connection: local
tasks:
- name: Copy VS Code changes to kasm-default-profile
shell:
cmd: cp -r /home/dev/.config/Code/ /home/kasm-default-profile/.config/Code/ && cp -r /home/dev/.vscode/ /home/kasm-default-profile/.vscode/
- name: Remove dev user
user:
name: dev
state: absent
remove: yes
- name: Get disk usage
shell: df -h
register: disk_usage
- name: Display disk usage
debug:
msg: "{{ disk_usage.stdout }}"
# Three dots indicate the end of a YAML document
...