1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

record bare variables and use -e with the bare variables in the grep line

This commit is contained in:
Jerry Vonau 2020-10-09 07:30:18 -05:00
parent 46448daeab
commit 3d0bdc47e4

View file

@ -106,7 +106,7 @@
register: wifi_gateway_found register: wifi_gateway_found
when: discovered_wireless_iface != "none" when: discovered_wireless_iface != "none"
- name: Set has_wifi_gateway for {{ discovered_wireless_iface }} when WiFi gateway has been detected - name: Set has_wifi_gateway if WiFi has default gateway detected for {{ discovered_wireless_iface }}
set_fact: set_fact:
has_wifi_gateway: True has_wifi_gateway: True
when: discovered_wireless_iface != "none" and (wifi_gateway_found.stdout|int > 0) when: discovered_wireless_iface != "none" and (wifi_gateway_found.stdout|int > 0)
@ -118,7 +118,7 @@
- name: Set exclude_devices if default gateway has been detected for {{ second_gateway_found.stdout }} - name: Set exclude_devices if default gateway has been detected for {{ second_gateway_found.stdout }}
set_fact: set_fact:
exclude_devices: "-e {{ second_gateway_found.stdout }}" exclude_devices: "{{ second_gateway_found.stdout }}"
when: second_gateway_found.stdout != "" when: second_gateway_found.stdout != ""
# 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
@ -131,11 +131,11 @@
- name: Exclude reserved Network Adapter if defined - takes adapter name - name: Exclude reserved Network Adapter if defined - takes adapter name
set_fact: set_fact:
exclude_devices: "-e {{ reserved_device }} {{ exclude_devices }}" exclude_devices: "{{ exclude_devices }} -e {{ reserved_device }}"
when: reserved_device is defined when: reserved_device is defined
- name: Count LAN ifaces - name: Count LAN ifaces
shell: ls /sys/class/net | grep -v {{ virtual_network_devices }} -e wwlan -e ppp -e {{ device_gw }} {{ exclude_devices }} | wc -l shell: ls /sys/class/net | grep -v {{ virtual_network_devices }} -e wwlan -e ppp -e {{ device_gw }} -e {{ exclude_devices }} | wc -l
register: num_lan_interfaces_result register: num_lan_interfaces_result
- name: Calculate number of LAN interfaces including WiFi - name: Calculate number of LAN interfaces including WiFi
@ -144,7 +144,7 @@
# 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 {{ virtual_network_devices }} -e wwlan -e ppp -e {{ device_gw }} {{ exclude_devices }} shell: ls /sys/class/net | grep -v {{ virtual_network_devices }} -e wwlan -e ppp -e {{ device_gw }} -e {{ exclude_devices }}
when: num_lan_interfaces != "0" when: num_lan_interfaces != "0"
register: lan_list_result register: lan_list_result