]> freie-schul-it.de Git - fsit-cmgt.git/commitdiff
SchulWLAN für alle Devices konfigurieren
authorUllli <ullli@freie-schul-it.de>
Wed, 24 May 2023 16:00:00 +0000 (18:00 +0200)
committerUllli <ullli@freie-schul-it.de>
Wed, 24 May 2023 16:00:00 +0000 (18:00 +0200)
library/wifi-for-notebooks.yml [new file with mode: 0644]

diff --git a/library/wifi-for-notebooks.yml b/library/wifi-for-notebooks.yml
new file mode 100644 (file)
index 0000000..b1492ca
--- /dev/null
@@ -0,0 +1,19 @@
+---
+- name: check if wifi-connection(-file) exists
+  stat:
+    path: /etc/NetworkManager/system-connections/SchulWLAN.nmconnection
+  register: stat_result
+- name: connect device to internal wifi "schulnetz"
+  block:
+  - name: add hidden wifi
+    command: nmcli connection add type wifi con-name SchulWLAN ifname {{ wifi_ifname }} ssid {{ wlan-ssid }}
+  - name: modify wifi password
+    command: nmcli connection modify SchulWLAN wifi-sec.key-mgmt wpa-psk wifi-sec.psk "{{ wlan-pw }}"
+  - name: autoconnect wifi
+    command: nmcli connection modify SchulWLAN connection.autoconnect yes
+  - name: modify wifi hidden
+    command: nmcli connection modify SchulWLAN 802-11-wireless.hidden yes
+  - name: connect wifi
+    command: nmcli connection up SchulWLAN
+  when: not stat_result.stat.exists and ("notebooks" in group_names)
+...