This commit is contained in:
2024-09-01 22:27:07 +03:00
parent 9108e5f4d7
commit 1b0d5ff144
6 changed files with 37 additions and 9 deletions

View File

@@ -35,12 +35,29 @@
state: stopped
enabled: false
- name: Get physical interfaces names
- name: Configure dnsmasq
template:
src: dnsmasq.conf.j2
dest: /etc/dnsmasq.conf
- name: Configure NetworkManager
template:
src: NetworkManager.conf.j2
dest: /etc/NetworkManager/NetworkManager.conf
notify: Reload NetworkManager
- name: Get physical interfaces names WIFI modems
command: find /sys/class/net -type l -lname '*wlp*' -printf '%f\n'
register: wifi_int
changed_when: false
check_mode: false
- name: Get physical interfaces names LTE modems
command: find /sys/class/net -type l -lname '*wwp*' -printf '%f\n'
register: lte_int
changed_when: false
check_mode: false
- name: Run nmcli to check if wifi access point connection has already been added
shell: /usr/bin/nmcli c | grep {{ wifi_ssid }}
register: nmcli_result
@@ -54,6 +71,9 @@
command: /usr/bin/nmcli c add autoconnect yes save yes con-name {{ wifi_ssid }} ifname {{ wifi_int.stdout }} type wifi ssid {{ wifi_ssid }} mode ap ip4 {{ wifi_int_ip }}
when: nmcli_failed
- name: Run nmcli to add a connection LTE
command: /usr/bin/nmcli c add autoconnect yes save yes con-name TLE ifname {{ lte_int.stdout }} type gsm apn "internet"
- name: Run nmcli to add WPA-PSK security to the wifi connection
command: /usr/bin/nmcli c mod {{ wifi_ssid }} \
802-11-wireless.band bg \