mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
2515 fix
This commit is contained in:
parent
01d418e374
commit
797aee3e9f
1 changed files with 18 additions and 17 deletions
|
@ -101,21 +101,32 @@
|
|||
set_fact:
|
||||
num_wifi_interfaces: "{{ count_wifi_interfaces.stdout|int }}"
|
||||
|
||||
- name: Detect wifi gateway active
|
||||
shell: ip r | grep default | grep {{ discovered_wireless_iface }} | wc -l
|
||||
register: wifi_gateway_found
|
||||
when: discovered_wireless_iface != "none"
|
||||
|
||||
- name: Set has_wifi_gateway for {{ discovered_wireless_iface }} if gateway is detected
|
||||
set_fact:
|
||||
exclude_device: "-e {{ discovered_wireless_iface }}"
|
||||
has_wifi_gateway: True
|
||||
when: discovered_wireless_iface != "none" and (wifi_gateway_found.stdout|int > 0)
|
||||
|
||||
# XO hack here ap_device would not be active therefore not set with
|
||||
# wired as gw use ap_device to exclude eth0 from network calulations
|
||||
|
||||
- name: XO laptop override 2 WiFi on LAN
|
||||
set_fact:
|
||||
exclude_device: "eth0"
|
||||
when: iiab_wan_iface != "eth0" and discovered_wireless_iface != "none" and xo_model == "XO-1.5"
|
||||
#- name: XO laptop override 2 WiFi on LAN
|
||||
# set_fact:
|
||||
# exclude_device: "eth0"
|
||||
# when: iiab_wan_iface != "eth0" and discovered_wireless_iface != "none" and xo_model == "XO-1.5"
|
||||
|
||||
- name: Exclude reserved Network Adapter if defined - takes adapter name
|
||||
set_fact:
|
||||
exclude_device: "{{ reserved_device }}"
|
||||
exclude_device: "-e {{ reserved_device }} {{ exclude_device }}"
|
||||
when: reserved_device is defined
|
||||
|
||||
- name: Count LAN ifaces
|
||||
shell: ls /sys/class/net | grep -v {{ virtual_network_devices }} -e wwlan -e ppp -e {{ device_gw }} -e {{ exclude_device }} | wc -l
|
||||
shell: ls /sys/class/net | grep -v {{ virtual_network_devices }} -e wwlan -e ppp -e {{ device_gw }} {{ exclude_device }} | wc -l
|
||||
register: num_lan_interfaces_result
|
||||
|
||||
- name: Calculate number of LAN interfaces including WiFi
|
||||
|
@ -124,7 +135,7 @@
|
|||
|
||||
# LAN - pick non WAN's
|
||||
- name: Create list of LAN (non WAN) ifaces
|
||||
shell: ls /sys/class/net | grep -v {{ virtual_network_devices }} -e wwlan -e ppp -e {{ device_gw }} -e {{ exclude_device }}
|
||||
shell: ls /sys/class/net | grep -v {{ virtual_network_devices }} -e wwlan -e ppp -e {{ device_gw }} {{ exclude_device }}
|
||||
when: num_lan_interfaces != "0"
|
||||
register: lan_list_result
|
||||
|
||||
|
@ -145,16 +156,6 @@
|
|||
with_items:
|
||||
- "{{ lan_list_result.stdout_lines }}"
|
||||
|
||||
- name: Detect wifi gateway active
|
||||
shell: ip r | grep default | grep {{ discovered_wireless_iface }} | wc -l
|
||||
when: discovered_wireless_iface != "none"
|
||||
register: wifi_gateway_found
|
||||
|
||||
- name: Set has_wifi_gateway for {{ discovered_wireless_iface }} if gateway is detected
|
||||
set_fact:
|
||||
has_wifi_gateway: True
|
||||
when: wifi_gateway_found is defined and (wifi_gateway_found.stdout|int > 0)
|
||||
|
||||
- name: Set iiab_wireless_lan_iface to {{ discovered_wireless_iface }} if not none
|
||||
set_fact:
|
||||
iiab_wireless_lan_iface: "{{ discovered_wireless_iface }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue