mirror of
https://github.com/iiab/iiab.git
synced 2025-02-15 04:32:11 +00:00
don't run lan_list_result when 'Count LAN ifaces' is zero to quite
down noisy log when detecting single interface
This commit is contained in:
parent
4079043456
commit
7b5de542cf
1 changed files with 7 additions and 10 deletions
|
@ -92,23 +92,20 @@
|
|||
ap_device: "{{ blacklist_wifi }}"
|
||||
when: blacklist_wifi is defined and discovered_wireless_iface != iiab_wan_iface and num_wifi_interfaces >= "2"
|
||||
|
||||
# LAN - pick non WAN's
|
||||
- name: Create list of LAN (non WAN) ifaces
|
||||
shell: ls /sys/class/net | grep -v -e wwlan -e ppp -e lo -e br0 -e tun -e {{ device_gw }} -e {{ ap_device }}
|
||||
register: lan_list_result
|
||||
ignore_errors: True
|
||||
changed_when: false
|
||||
|
||||
- name: Count LAN ifaces
|
||||
shell: ls /sys/class/net | grep -v -e wwlan -e ppp -e lo -e br0 -e tun -e {{ device_gw }} -e {{ ap_device }} | wc -l
|
||||
register: num_lan_interfaces_result
|
||||
ignore_errors: True
|
||||
changed_when: false
|
||||
|
||||
- name: Calculate number of LAN interfaces including WiFi
|
||||
set_fact:
|
||||
num_lan_interfaces: "{{ num_lan_interfaces_result.stdout|int }}"
|
||||
|
||||
# LAN - pick non WAN's
|
||||
- name: Create list of LAN (non WAN) ifaces
|
||||
shell: ls /sys/class/net | grep -v -e wwlan -e ppp -e lo -e br0 -e tun -e {{ device_gw }} -e {{ ap_device }}
|
||||
when: num_lan_interfaces != 0
|
||||
register: lan_list_result
|
||||
|
||||
# If 2 interfaces found in gateway mode, with one wifi, declare other to be wan
|
||||
#- name: In gateway mode with one wifi adapter, the other is WAN
|
||||
# set_fact:
|
||||
|
@ -122,7 +119,7 @@
|
|||
- name: Set discovered_wired_iface fact if present
|
||||
set_fact:
|
||||
discovered_wired_iface: "{{ item|trim }}"
|
||||
when: item|trim != discovered_wireless_iface
|
||||
when: item|trim != discovered_wireless_iface and lan_list_result is defined
|
||||
with_items:
|
||||
- "{{ lan_list_result.stdout_lines }}"
|
||||
|
||||
|
|
Loading…
Reference in a new issue