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

raspbian lite images has awk but not gawk (#189)

This commit is contained in:
georgejhunt 2017-09-11 09:14:13 -07:00 committed by GitHub
parent f8c8c61bd5
commit 41dbbf167f

View file

@ -31,7 +31,7 @@
# DETECT -- gateway and wireless
- name: Get a list of slaves from previous config
shell: "egrep -rn BRIDGE=br0 /etc/sysconfig/network-scripts/ifcfg-* | gawk -F'[-:]' '{print $3}'"
shell: "egrep -rn BRIDGE=br0 /etc/sysconfig/network-scripts/ifcfg-* | awk -F'[-:]' '{print $3}'"
register: ifcfg_slaves
ignore_errors: True
changed_when: False
@ -76,7 +76,7 @@
# returns list of paths
- name: Find gateway config based on device
shell: "egrep -rn {{ device_gw }} /etc/sysconfig/network-scripts/ifcfg* | gawk -F ':' '{print $1}'"
shell: "egrep -rn {{ device_gw }} /etc/sysconfig/network-scripts/ifcfg* | awk -F ':' '{print $1}'"
register: ifcfg_gw_device
ignore_errors: True
changed_when: False
@ -93,7 +93,7 @@
# returns path
- name: Find active gateway config based on macaddress
shell: "egrep -irn {{ ansible_default_ipv4.macaddress }} /etc/sysconfig/network-scripts/ifcfg* | gawk -F ':' '{print $1}' | head -n 1"
shell: "egrep -irn {{ ansible_default_ipv4.macaddress }} /etc/sysconfig/network-scripts/ifcfg* | awk -F ':' '{print $1}' | head -n 1"
register: ifcfg_gw_mac
ignore_errors: True
changed_when: False
@ -106,7 +106,7 @@
# could use something else
- name: Find wifi gateway config if present
shell: egrep -rn ESSID /etc/sysconfig/network-scripts/ifcfg* | gawk -F ':' '{print $1}' | gawk -F '/' '{print $5}'
shell: egrep -rn ESSID /etc/sysconfig/network-scripts/ifcfg* | awk -F ':' '{print $1}' | awk -F '/' '{print $5}'
register: ifcfg_WAN_wifi
ignore_errors: True
@ -119,7 +119,7 @@
- "{{ ifcfg_WAN_wifi.stdout_lines }}"
- name: Finding device for wifi AP gateway
shell: egrep -rn DEVICE /etc/sysconfig/network-scripts/{{ has_wifi_gw }} | gawk -F '=' '{print $2}'
shell: egrep -rn DEVICE /etc/sysconfig/network-scripts/{{ has_wifi_gw }} | awk -F '=' '{print $2}'
register: AP_device
when: has_wifi_gw != "none" and has_ifcfg_gw != "none"
@ -130,7 +130,7 @@
# WIRELESS -- if any wireless is detected as gateway, it becomes WAN
- name: Look for any wireless interfaces
shell: "cat /proc/net/wireless | grep -v -e Inter -e face | gawk -F: '{print $1}' "
shell: "cat /proc/net/wireless | grep -v -e Inter -e face | awk -F: '{print $1}' "
register: wireless_list1
ignore_errors: True
changed_when: False