From 17c69eca7400ea969e3f44b681d79717e8514c83 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 19 Mar 2020 05:59:21 -0500 Subject: [PATCH] network exclude ap0 --- roles/network/tasks/computed_network.yml | 18 +++++++++--------- roles/network/tasks/detected_network.yml | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/roles/network/tasks/computed_network.yml b/roles/network/tasks/computed_network.yml index e297986e8..fb27dc7b5 100644 --- a/roles/network/tasks/computed_network.yml +++ b/roles/network/tasks/computed_network.yml @@ -109,13 +109,13 @@ # make it so number 2 vars should use user_wan_iface but we can cover a single # wired if dhcp fails the interface should revert to LAN, static address should # stick around but testing gateway response is not performed. -- name: User wants single wired interface as static or dhcp gateway - set_fact: - user_wan_iface: "{{ discovered_wan_iface }}" # Jan 2018: Holt discovered_lan_iface was UNDEFINED on WiFi-installed - # RPi (when re-running ./iiab-network) so "discovered_wan_iface" is a - # workaround -- please see https://github.com/iiab/iiab/pull/649 - # This workaround can and should evolve as IIAB 6.5 matures! - when: num_lan_interfaces == "1" and user_lan_iface == "auto" and user_wan_iface == "auto" +#- name: User wants single wired interface as static or dhcp gateway +# set_fact: +# user_wan_iface: "{{ discovered_wan_iface }}" # Jan 2018: Holt discovered_lan_iface was UNDEFINED on WiFi-installed +# # RPi (when re-running ./iiab-network) so "discovered_wan_iface" is a +# # workaround -- please see https://github.com/iiab/iiab/pull/649 +# # This workaround can and should evolve as IIAB 6.5 matures! +# when: num_lan_interfaces == "1" and user_lan_iface == "auto" and user_wan_iface == "auto" - name: Use old gateway device info if not detected and using static ip set_fact: @@ -152,14 +152,14 @@ - name: We're hosed no work interfaces set_fact: iiab_network_mode: "No_network_found" - when: adapter_count.stdout|int == "0" + when: adapter_count.stdout|int == 0 # well if there ever was a point to tell the user things are FUBAR this is it. - name: I'm not guessing declare gateway please set_fact: iiab_network_mode: "Undetectable_use_local_vars" iiab_wan_iface: "none" - when: adapter_count.stdout|int >= "5" and device_gw == "none" and gui_wan_iface == "unset" and gui_static_wan is defined + when: adapter_count.stdout|int >= 5 and device_gw == "none" and gui_wan_iface == "unset" and gui_static_wan is defined - name: Record IIAB_WAN_DEVICE to {{ iiab_env_file }} lineinfile: diff --git a/roles/network/tasks/detected_network.yml b/roles/network/tasks/detected_network.yml index 66d4dcbb3..25f71d48d 100644 --- a/roles/network/tasks/detected_network.yml +++ b/roles/network/tasks/detected_network.yml @@ -75,7 +75,7 @@ set_fact: wifi2: "{{ item|trim }}" discovered_wireless_iface: "{{ item|trim }}" - when: wireless_list2.stdout is defined + when: wireless_list2.stdout is defined and not wireless_list2.stdout == "ap0" with_items: - "{{ wireless_list2.stdout_lines }}" #item|trim != discovered_wan_iface @@ -103,7 +103,7 @@ when: reserved_wifi is defined and discovered_wireless_iface != iiab_wan_iface and num_wifi_interfaces >= "2" - name: Count LAN ifaces - shell: ls /sys/class/net | grep -v -e wwlan -e ppp -e lo -e br0 -e tun -e br- -e docker -e bridge0 -e veth -e {{ device_gw }} -e {{ ap_device }} | wc -l + shell: ls /sys/class/net | grep -v -e ap0 -e wwlan -e ppp -e lo -e br0 -e tun -e br- -e docker -e bridge0 -e veth -e {{ device_gw }} -e {{ ap_device }} | wc -l register: num_lan_interfaces_result - name: Calculate number of LAN interfaces including WiFi @@ -112,7 +112,7 @@ # 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 br- -e docker -e bridge0 -e veth -e {{ device_gw }} -e {{ ap_device }} + shell: ls /sys/class/net | grep -v -e ap0 -e wwlan -e ppp -e lo -e br0 -e tun -e br- -e docker -e bridge0 -e veth -e {{ device_gw }} -e {{ ap_device }} when: num_lan_interfaces != "0" register: lan_list_result