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

Readability tweaks

This commit is contained in:
A Holt 2018-01-11 00:32:41 -05:00 committed by GitHub
parent 8d36117fd9
commit f700843f69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,7 +3,7 @@
# ifcfg-rh acts on /etc/sys*/net*/ifcfg-* where we search for devices. # ifcfg-rh acts on /etc/sys*/net*/ifcfg-* where we search for devices.
- name: Setting XO has WiFi gateway - name: Setting XO has WiFi gateway
set_fact: set_fact:
user_wan_iface: "{{ discovered_wan_iface }}" user_wan_iface: "{{ discovered_wan_iface }}"
when: discovered_wan_iface != "none" and xo_model != "none" and has_ifcfg_gw == "none" when: discovered_wan_iface != "none" and xo_model != "none" and has_ifcfg_gw == "none"
#- name: Checking for NetworkManager-config-server #- name: Checking for NetworkManager-config-server
@ -22,7 +22,7 @@
- name: XO laptop wants USB WiFi interface as AP mode - name: XO laptop wants USB WiFi interface as AP mode
set_fact: set_fact:
iiab_wireless_lan_iface: "{{ discovered_lan_iface }}" iiab_wireless_lan_iface: "{{ discovered_lan_iface }}"
when: num_wifi_interfaces >= "2" and xo_model != "none" and discovered_wan_iface != "none" and discovered_wireless_iface == "eth0" when: num_wifi_interfaces >= "2" and xo_model != "none" and discovered_wan_iface != "none" and discovered_wireless_iface == "eth0"
# static backout suppy new template file # static backout suppy new template file
@ -34,7 +34,7 @@
- name: Undo gui-static-wan by requesting new template file - name: Undo gui-static-wan by requesting new template file
set_fact: set_fact:
has_WAN: False has_WAN: False
when: gui_static_wan_ip != "unset" and not gui_static_wan when: gui_static_wan_ip != "unset" and not gui_static_wan
# figure out more than one interfaces to detect. # figure out more than one interfaces to detect.
@ -77,7 +77,7 @@
- name: Setting user_lan_iface for 'LanController' for single interface - name: Setting user_lan_iface for 'LanController' for single interface
set_fact: set_fact:
user_lan_iface: "{{ discovered_wan_iface }}" user_lan_iface: "{{ discovered_wan_iface }}"
when: discovered_wan_iface != "none" and num_lan_interfaces == "0" and gui_desired_network_role is defined and gui_desired_network_role == "LanController" when: discovered_wan_iface != "none" and num_lan_interfaces == "0" and gui_desired_network_role is defined and gui_desired_network_role == "LanController"
# override with user_wan_iface setting if no longer in auto # override with user_wan_iface setting if no longer in auto
@ -108,10 +108,10 @@
# make it so number 2 vars should use user_wan_iface but we can cover a single # 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 # wired if dhcp fails the interface should revert to LAN, static address should
# stick around but testing gateway response is not preformed. # stick around but testing gateway response is not performed.
- name: User wants single wired interface as static or dhcp gateway - name: User wants single wired interface as static or dhcp gateway
set_fact: set_fact:
user_wan_iface: "{{ discovered_lan_iface }}" user_wan_iface: "{{ discovered_lan_iface }}"
when: num_lan_interfaces == "1" and user_lan_iface == "auto" and user_wan_iface == "auto" when: num_lan_interfaces == "1" and user_lan_iface == "auto" and user_wan_iface == "auto"
- name: No LAN configured - 'Appliance' mode - name: No LAN configured - 'Appliance' mode
@ -154,30 +154,31 @@
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: Add location section to config file - name: Add location section to config file
ini_file: dest='{{ iiab_config_file }}' ini_file:
section=computed_network dest: "{{ iiab_config_file }}"
option='{{ item.option }}' section: computed_network
value='{{ item.value }}' option: "{{ item.option }}"
value: "{{ item.value }}"
with_items: with_items:
- option: 'iiab_wan_enabled' - option: iiab_wan_enabled
value: '{{ iiab_wan_enabled }}' value: "{{ iiab_wan_enabled }}"
- option: 'user_wan_iface' - option: user_wan_iface
value: '{{ user_wan_iface }}' value: "{{ user_wan_iface }}"
- option: 'iiab_wan_iface' - option: iiab_wan_iface
value: '{{ iiab_wan_iface }}' value: "{{ iiab_wan_iface }}"
- option: 'iiab_lan_enabled' - option: iiab_lan_enabled
value: '{{ iiab_lan_enabled }}' value: "{{ iiab_lan_enabled }}"
- option: 'user_lan_iface' - option: user_lan_iface
value: '{{ user_lan_iface }}' value: "{{ user_lan_iface }}"
- option: 'iiab_lan_iface' - option: iiab_lan_iface
value: '{{ iiab_lan_iface }}' value: "{{ iiab_lan_iface }}"
- option: 'iiab_network_mode' - option: iiab_network_mode
value: '{{ iiab_network_mode }}' value: "{{ iiab_network_mode }}"
- option: 'hostapd_enabled' - option: hostapd_enabled
value: '{{ hostapd_enabled }}' value: "{{ hostapd_enabled }}"
- option: 'host_ssid' - option: host_ssid
value: '{{ host_ssid }}' value: "{{ host_ssid }}"
- option: 'host_wifi_mode' - option: host_wifi_mode
value: '{{ host_wifi_mode }}' value: "{{ host_wifi_mode }}"
- option: 'host_channel' - option: host_channel
value: '{{ host_channel }}' value: "{{ host_channel }}"