]> freie-schul-it.de Git - fsit-cmgt.git/blob - library/wifi-for-notebooks.yml
autoremove als einzelnen task, damit es funktioniert
[fsit-cmgt.git] / library / wifi-for-notebooks.yml
1 ---
2 - name: check if wifi-connection(-file) exists
3 stat:
4 path: /etc/NetworkManager/system-connections/SchulWLAN.nmconnection
5 register: stat_result
6 - name: connect device to internal wifi "schulnetz"
7 block:
8 - name: add hidden wifi
9 command: nmcli connection add type wifi con-name SchulWLAN ifname {{ wifi_ifname }} ssid {{ wlan-ssid }}
10 - name: modify wifi password
11 command: nmcli connection modify SchulWLAN wifi-sec.key-mgmt wpa-psk wifi-sec.psk "{{ wlan-pw }}"
12 - name: autoconnect wifi
13 command: nmcli connection modify SchulWLAN connection.autoconnect yes
14 - name: modify wifi hidden
15 command: nmcli connection modify SchulWLAN 802-11-wireless.hidden yes
16 - name: connect wifi
17 command: nmcli connection up SchulWLAN
18 when: not stat_result.stat.exists and ("notebooks" in group_names)
19 ...