Refactor lmn_wlan role
- Consolidate `lmn_wlan`, `lmn_wlan_nm`, and `lmn_wlan_8021x` into single `lmn_wlan` role. - Implement a check for the availability of the radius-server during the EAP-TLS rollout. - Enhance variable support with a standardized naming schema: - Mode selection via `wlan` variable (`none`, `psk`, `eap-tls`). - EAP-TLS CA configuration (CA information, email address, CA password). - Introduce a switch to force the (re-)issue of existing certificates. - PSK configuration through `wlan_ssid` and `wlan_password`. - Add a check to verify if the radius certificate is revoked. - Ensure required packages and services are only installed and configured if the `wifi` variable is set.
This commit is contained in:
parent
9f1c60eefd
commit
a68aaeb81c
9 changed files with 561 additions and 538 deletions
42
roles/lmn_wlan/tasks/main.yaml
Normal file
42
roles/lmn_wlan/tasks/main.yaml
Normal file
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
# Setup requirements
|
||||
- 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"
|
||||
|
||||
# lmn_wlan - Initial configuration based on the WLAN variable
|
||||
# When WLAN type is set to PSK
|
||||
- name: Configure WPA-PSK
|
||||
ansible.builtin.include_tasks: wpa-psk.yaml
|
||||
when: wlan == 'psk'
|
||||
|
||||
# When WLAN type is set to EAP-TLS (802.1x)
|
||||
- name: Configure WPA-Enterprise (EAP-TLS)
|
||||
ansible.builtin.include_tasks: eap-tls_check-certificate.yaml
|
||||
when: wlan == 'eap-tls'
|
Loading…
Add table
Add a link
Reference in a new issue