From bf940a2956e9ac0018b866eb18a2a1351a4a0a1e Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sun, 30 Apr 2023 10:07:41 +0200 Subject: [PATCH 1/6] linroom: fix VS code extension permissions And clean up the installation script a bit. --- roles/linroom/handlers/main.yml | 4 ++++ roles/linroom/tasks/vscode.yml | 23 +++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 roles/linroom/handlers/main.yml diff --git a/roles/linroom/handlers/main.yml b/roles/linroom/handlers/main.yml new file mode 100644 index 0000000..70c210e --- /dev/null +++ b/roles/linroom/handlers/main.yml @@ -0,0 +1,4 @@ +# Mark everything in bin/ directories executable. Some extensions do +# this on activation, but non-root users don’t have permission for it. +- name: fix VS code extensions + command: find /usr/share/code/resources/app -name bin -exec chmod -R +x '{}' ';' diff --git a/roles/linroom/tasks/vscode.yml b/roles/linroom/tasks/vscode.yml index da2c551..214204d 100644 --- a/roles/linroom/tasks/vscode.yml +++ b/roles/linroom/tasks/vscode.yml @@ -1,21 +1,19 @@ -- name: Add VS repository - block: - - name: VS repo - apt key - ansible.builtin.get_url: - url: https://packages.microsoft.com/keys/microsoft.asc - dest: /etc/apt/trusted.gpg.d/microsoft_key.asc - - name: VS repo - url - ansible.builtin.apt_repository: - repo: "deb https://packages.microsoft.com/repos/vscode stable main" - state: present +- name: Add VS repo key + apt_key: + url: https://packages.microsoft.com/keys/microsoft.asc + keyring: /etc/apt/trusted.gpg.d/microsoft.gpg + +- name: Add VS repo url + apt_repository: + repo: "deb https://packages.microsoft.com/repos/vscode stable main" - name: Install VSCode - ansible.builtin.apt: + apt: name: code state: latest - name: Install VS Code extensions - shell: code --no-sandbox --user-data-dir "/usr/share/code/resources/app" --extensions-dir "/usr/share/code/resources/app/extensions" --install-extension "{{ item }}" + command: code --no-sandbox --user-data-dir "/usr/share/code/resources/app" --extensions-dir "/usr/share/code/resources/app/extensions" --install-extension "{{ item }}" loop: - VisualStudioExptTeam.vscodeintellicode - arthurwang.vsc-prolog @@ -33,3 +31,4 @@ - marus25.cortex-debug # RA-63703 - NateAGeek.memory-viewer # RA-63703 - ms-vscode.cpptools-extension-pack # RA-63703 + notify: fix VS code extensions From 83b888dcf77de99847ef83c08c632e1617124507 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Mon, 1 May 2023 18:32:44 +0200 Subject: [PATCH 2/6] linroom: fix Wake-on-LAN setup Add missing ethtool. Rename file as it is necessary on non-Intel devices also. Ensure the udev rule is applied after 80-net-setup-link. --- roles/linroom/files/99-wakeonlan.rules | 1 + roles/linroom/tasks/fri_base.yml | 6 ++---- roles/linroom/tasks/wake-on-lan.yml | 8 ++++++++ roles/linroom/templates/intel-wol.rules | 1 - 4 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 roles/linroom/files/99-wakeonlan.rules create mode 100644 roles/linroom/tasks/wake-on-lan.yml delete mode 100644 roles/linroom/templates/intel-wol.rules diff --git a/roles/linroom/files/99-wakeonlan.rules b/roles/linroom/files/99-wakeonlan.rules new file mode 100644 index 0000000..d4729ac --- /dev/null +++ b/roles/linroom/files/99-wakeonlan.rules @@ -0,0 +1 @@ +ACTION=="add", SUBSYSTEM=="net", NAME=="e*", RUN+="/usr/sbin/ethtool -s $name wol g" diff --git a/roles/linroom/tasks/fri_base.yml b/roles/linroom/tasks/fri_base.yml index 7e22a42..47c0f11 100644 --- a/roles/linroom/tasks/fri_base.yml +++ b/roles/linroom/tasks/fri_base.yml @@ -100,10 +100,8 @@ - name: Set time to local RTC shell: "timedatectl set-local-rtc 1 --adjust-system-clock" -- name: Fix WoL on Intel - template: - src: intel-wol.rules - dest: /etc/udev/rules.d/79-wol.rules +- name: Enable Wake-on-LAN + import_tasks: wake-on-lan.yml - name: Join AD shell: "realm join --user=ad.join@FRI1.UNI-LJ.SI --computer-ou=OU=Ucilnice FRI1.UNI-LJ.SI" diff --git a/roles/linroom/tasks/wake-on-lan.yml b/roles/linroom/tasks/wake-on-lan.yml new file mode 100644 index 0000000..c648b58 --- /dev/null +++ b/roles/linroom/tasks/wake-on-lan.yml @@ -0,0 +1,8 @@ +- name: Install ethtool + apt: + name: ethtool + +- name: Add udev rule to enable wake-on-lan for ethernet interfaces + copy: + dest: /etc/udev/rules.d/ + src: 99-wakeonlan.rules diff --git a/roles/linroom/templates/intel-wol.rules b/roles/linroom/templates/intel-wol.rules deleted file mode 100644 index 8baa58e..0000000 --- a/roles/linroom/templates/intel-wol.rules +++ /dev/null @@ -1 +0,0 @@ -ACTION=="add", SUBSYSTEM=="net", NAME=="e*", RUN+="/sbin/ethtool -s $name wol g" From ba3ab3f6ab23e642c0c17ddc9836554e0e2bcd53 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sun, 25 Jun 2023 14:24:36 +0200 Subject: [PATCH 3/6] winroom: add Minecraft EE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not required by any specific class but let’s document here it’s available from chocolatey. --- roles/winroom/tasks/minecraft-education.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 roles/winroom/tasks/minecraft-education.yml diff --git a/roles/winroom/tasks/minecraft-education.yml b/roles/winroom/tasks/minecraft-education.yml new file mode 100644 index 0000000..92b0dc3 --- /dev/null +++ b/roles/winroom/tasks/minecraft-education.yml @@ -0,0 +1,3 @@ +- name: Install Minecraft Education + win_chocolatey: + name: minecraft-education From e4ba9607bda994fee613454e0590bbc698b3202c Mon Sep 17 00:00:00 2001 From: Polz Date: Wed, 30 Aug 2023 13:34:36 +0200 Subject: [PATCH 4/6] Added a slovenian readme for the teachers --- roles/README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 roles/README.md diff --git a/roles/README.md b/roles/README.md new file mode 100644 index 0000000..3013d5d --- /dev/null +++ b/roles/README.md @@ -0,0 +1,25 @@ +# Recepti za nameščanje programske opreme + +Recepti za nameščanje programske opreme v učilnicah FRI se nahajajo v: + + - linroom/tasks za GNU/Linux + - windows/tasks za Microsoft Windows + +Vsako leto predvidoma popravimo recepte - sezname potrebnih programov in recepte za nameščanje le-teh. + +## Zahteve za predmet + +V imeniku tasks za vsak predmet obstaja YAML datoteka s seznamom zahtevanih programov. +Na primer, za predmet Komunikacijski protokoli in omrežna varnost obstaja datoteka KPOV-63716.yml. +V datoteki je po ena vrstica z besedo "include" za vsak program, ki ga pri predmetu potrebujemo. + +Trenutno za vsak predmet obstajata po dve datoteki - ena pod linroom/tasks, druga pod winroom/tasks. + +## Nameščanje posameznega programa + +Datoteke za nameščanje programov se prav tako nahajajo v imeniku tasks. +Na primer, za nameščanje Microsoftovega VSCode, obstaja datoteka vscode.yml. + +Za nameščanje pod GNU/Linux in Windows sta datoteki seveda različni. + +Ker nekateri programi niso javno dostopni, se pri nekaterih receptih uporabljajo datoteke z datotečnega strežnika UcilniceSMB. Kako to popraviti, je zaenkrat odprto vprašanje. From 3f71ec5e9f6334743a1688483dd74e64909066dc Mon Sep 17 00:00:00 2001 From: Miha Grohar Date: Mon, 4 Sep 2023 08:18:37 +0000 Subject: [PATCH 5/6] Update vscode extension ms-dotnettools.csharp to ms-dotnettools.csdevkit --- roles/linroom/tasks/vscode.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/linroom/tasks/vscode.yml b/roles/linroom/tasks/vscode.yml index 214204d..048c836 100644 --- a/roles/linroom/tasks/vscode.yml +++ b/roles/linroom/tasks/vscode.yml @@ -20,7 +20,7 @@ - dramforever.vscode-ghc-simple - eamodio.gitlens - justusadam.language-haskell - - ms-dotnettools.csharp + - ms-dotnettools.csdevkit # IS-63714 - ms-python.python - ms-vscode.cpptools - ocamllabs.ocaml-platform From bea8094d7ca7e92a228b6d149f48845d1e2958ea Mon Sep 17 00:00:00 2001 From: Miha Grohar Date: Mon, 4 Sep 2023 08:20:55 +0000 Subject: [PATCH 6/6] Update vscode extension ms-dotnettools.csharp to ms-dotnettools.csdevkit. --- roles/winroom/tasks/vscode.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/winroom/tasks/vscode.yml b/roles/winroom/tasks/vscode.yml index 1d97ecb..63d0015 100644 --- a/roles/winroom/tasks/vscode.yml +++ b/roles/winroom/tasks/vscode.yml @@ -19,7 +19,7 @@ - dramforever.vscode-ghc-simple - eamodio.gitlens - justusadam.language-haskell - - ms-dotnettools.csharp + - ms-dotnettools.csdevkit # IS-63714 - ms-python.python - ms-vscode.cpptools - stonebuddha.vscode-better-sml