mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
cleaner output
This commit is contained in:
parent
ee55dea59b
commit
9fdcd5cbaa
1 changed files with 8 additions and 8 deletions
|
@ -61,30 +61,30 @@
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ wireless_list2.stdout_lines }}"
|
- "{{ wireless_list2.stdout_lines }}"
|
||||||
|
|
||||||
- name: Count Wifi ifaces
|
- name: Count WiFi ifaces
|
||||||
shell: "ls -la /sys/class/net/*/phy80211 | awk -F / '{print $5}' | wc -l"
|
shell: "ls -la /sys/class/net/*/phy80211 | awk -F / '{print $5}' | wc -l"
|
||||||
register: count_wifi_interfaces
|
register: count_wifi_interfaces
|
||||||
|
|
||||||
- name: Remember number of Wifi devices
|
- name: Remember number of WiFi devices
|
||||||
set_fact:
|
set_fact:
|
||||||
num_wifi_interfaces: "{{ count_wifi_interfaces.stdout|int }}"
|
num_wifi_interfaces: "{{ count_wifi_interfaces.stdout|int }}"
|
||||||
|
|
||||||
# XO hack here ap_device would not be active therefore not set with
|
# 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
|
# wired as gw use ap_device to exclude eth0 from network calulations
|
||||||
|
|
||||||
- name: XO override 2 wifi on LAN
|
- name: XO laptop override 2 WiFi on LAN
|
||||||
set_fact:
|
set_fact:
|
||||||
ap_device: "eth0"
|
ap_device: "eth0"
|
||||||
when: iiab_wan_iface != "eth0" and discovered_wireless_iface != "none" and xo_model == "XO-1.5"
|
when: iiab_wan_iface != "eth0" and discovered_wireless_iface != "none" and xo_model == "XO-1.5"
|
||||||
|
|
||||||
# takes adapter name
|
# takes adapter name
|
||||||
- name: Blacklisted wifi adapter
|
- name: Blacklisted WiFi adapter
|
||||||
set_fact:
|
set_fact:
|
||||||
ap_device: "{{ blacklist_wifi }}"
|
ap_device: "{{ blacklist_wifi }}"
|
||||||
when: blacklist_wifi is defined and discovered_wireless_iface != iiab_wan_iface and num_wifi_interfaces >= "2"
|
when: blacklist_wifi is defined and discovered_wireless_iface != iiab_wan_iface and num_wifi_interfaces >= "2"
|
||||||
|
|
||||||
# LAN - pick non WAN's
|
# LAN - pick non WAN's
|
||||||
- name: Create list of LAN (non wan) ifaces
|
- 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 }}
|
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
|
register: lan_list_result
|
||||||
ignore_errors: True
|
ignore_errors: True
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
|
|
||||||
# Select an adapter that is not WAN and not wireless
|
# Select an adapter that is not WAN and not wireless
|
||||||
# if there is more than one the last one wins
|
# if there is more than one the last one wins
|
||||||
- name: Set iiab discovered lan fact
|
- name: Set IIAB discovered_lan_iface fact
|
||||||
set_fact:
|
set_fact:
|
||||||
discovered_lan_iface: "{{ item|trim }}"
|
discovered_lan_iface: "{{ item|trim }}"
|
||||||
when: item|trim != discovered_wireless_iface and item|trim != discovered_wan_iface
|
when: item|trim != discovered_wireless_iface and item|trim != discovered_wan_iface
|
||||||
|
@ -128,12 +128,12 @@
|
||||||
# moved to detected_redhat
|
# moved to detected_redhat
|
||||||
|
|
||||||
# use value only if present
|
# use value only if present
|
||||||
- name: Setting detected lan
|
- name: Setting detected LAN
|
||||||
set_fact:
|
set_fact:
|
||||||
iiab_lan_iface: "{{ discovered_lan_iface }}"
|
iiab_lan_iface: "{{ discovered_lan_iface }}"
|
||||||
when: 'discovered_lan_iface != "none" and num_lan_interfaces == "1"'
|
when: 'discovered_lan_iface != "none" and num_lan_interfaces == "1"'
|
||||||
|
|
||||||
- name: for debian, always use bridging
|
- name: For Debian, always use bridging
|
||||||
set_fact:
|
set_fact:
|
||||||
iiab_lan_iface: br0
|
iiab_lan_iface: br0
|
||||||
when: 'discovered_lan_iface != "none" and num_lan_interfaces >= "1" and is_debuntu'
|
when: 'discovered_lan_iface != "none" and num_lan_interfaces >= "1" and is_debuntu'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue