
When implementing different wlan authentication modes (PSK/802-1x), we have to separate general wlan stuff in one generic role.
30 lines
745 B
YAML
30 lines
745 B
YAML
---
|
|
- 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"
|