Implement systemd-networkd and iwd for WLAN connection.
This commit is contained in:
parent
7dfe195716
commit
a057159c24
4 changed files with 62 additions and 1 deletions
27
roles/lmn_wlan_nm/tasks/main.yml
Normal file
27
roles/lmn_wlan_nm/tasks/main.yml
Normal file
|
@ -0,0 +1,27 @@
|
|||
## Make sure to use an initrd providing firmware:
|
||||
## wget https://cdimage.debian.org/cdimage/firmware/testing/current/firmware.cpio.gz
|
||||
## cat initrd.gz firmware.cpio.gz > initrd-fw.gz
|
||||
---
|
||||
- name: Configure WLAN for devices
|
||||
community.general.nmcli:
|
||||
conn_name: "{{ ssid }}"
|
||||
type: wifi
|
||||
ssid: "{{ ssid }}"
|
||||
ifname: "{{ ansible_interfaces | select('search', 'wl.+') | first }}"
|
||||
wifi_sec:
|
||||
key-mgmt: wpa-psk
|
||||
psk: "{{ wifipasswd }}"
|
||||
autoconnect: true
|
||||
state: present
|
||||
when: |
|
||||
not run_in_installer|default(false)|bool and
|
||||
ansible_interfaces | select('search', 'wl.+') | first is defined
|
||||
|
||||
- name: Provide WLAN config during installation
|
||||
template:
|
||||
src: ssid.nmconnection.j2
|
||||
dest: "/etc/NetworkManager/system-connections/{{ ssid }}.nmconnection"
|
||||
mode: '0600'
|
||||
when: |
|
||||
run_in_installer|default(false)|bool and
|
||||
ansible_interfaces | select('search', 'wl.+') | first is defined
|
21
roles/lmn_wlan_nm/templates/ssid.nmconnection.j2
Normal file
21
roles/lmn_wlan_nm/templates/ssid.nmconnection.j2
Normal file
|
@ -0,0 +1,21 @@
|
|||
[connection]
|
||||
id=FVS-devices
|
||||
type=wifi
|
||||
interface-name={{ ansible_interfaces | select('search', 'wl.+') | first }}
|
||||
|
||||
[wifi]
|
||||
mode=infrastructure
|
||||
ssid=FVS-devices
|
||||
|
||||
[wifi-security]
|
||||
key-mgmt=wpa-psk
|
||||
psk={{ wifipasswd }}
|
||||
|
||||
[ipv4]
|
||||
method=auto
|
||||
|
||||
[ipv6]
|
||||
addr-gen-mode=default
|
||||
method=auto
|
||||
|
||||
[proxy]
|
Loading…
Add table
Add a link
Reference in a new issue