From acbd76a5312d9f700f2eebfa1ac6580b4aea74bb Mon Sep 17 00:00:00 2001 From: Ullli Date: Wed, 24 May 2023 18:00:00 +0200 Subject: [PATCH] =?utf8?q?SchulWLAN=20f=C3=BCr=20alle=20Devices=20konfigur?= =?utf8?q?ieren?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- library/wifi-for-notebooks.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 library/wifi-for-notebooks.yml diff --git a/library/wifi-for-notebooks.yml b/library/wifi-for-notebooks.yml new file mode 100644 index 0000000..b1492ca --- /dev/null +++ b/library/wifi-for-notebooks.yml @@ -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) +... -- 2.39.5