Create generic wlan role

When implementing different wlan authentication modes (PSK/802-1x), we
have to separate general wlan stuff in one generic role.
This commit is contained in:
Raphael Dannecker 2025-02-27 12:28:21 +01:00
parent 72340155ed
commit 843289d2c2
2 changed files with 31 additions and 0 deletions

View file

@ -353,6 +353,7 @@
when: ansible_interfaces | select('search', 'wl.+') | first is defined
- role: lmn_localuser
when: "'teacherlaptop' not in group_names"
- role: lmn_wlan
- role: lmn_wlan_8021x
tags:
- never

View file

@ -0,0 +1,30 @@
---
- name: Install packages related to wifi
ansible.builtin.apt:
name:
- systemd-resolved
- firmware-realtek # for our wifi sticks
- name: Provide service to enable WiFi on boot
ansible.builtin.copy:
dest: /etc/systemd/system/enable-wifi.service
mode: '0644'
content: |
[Unit]
Description=Switch WiFi on
After=NetworkManager.service
[Service]
Type=oneshot
ExecStart=/usr/bin/nmcli radio wifi on
[Install]
WantedBy=multi-user.target
when: "'teacherlaptop' not in group_names"
- name: Enable the enable-wifi service
ansible.builtin.systemd:
name: enable-wifi.service
enabled: true
daemon_reload: true
when: "'teacherlaptop' not in group_names"