From f700843f69579b3c9800aea0682dc5e386af4112 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 11 Jan 2018 00:32:41 -0500 Subject: [PATCH] Readability tweaks --- roles/network/tasks/computed_network.yml | 65 ++++++++++++------------ 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/roles/network/tasks/computed_network.yml b/roles/network/tasks/computed_network.yml index 6b3eba538..d2f7bdb1d 100644 --- a/roles/network/tasks/computed_network.yml +++ b/roles/network/tasks/computed_network.yml @@ -3,7 +3,7 @@ # ifcfg-rh acts on /etc/sys*/net*/ifcfg-* where we search for devices. - name: Setting XO has WiFi gateway 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" #- name: Checking for NetworkManager-config-server @@ -22,7 +22,7 @@ - name: XO laptop wants USB WiFi interface as AP mode 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" # static backout suppy new template file @@ -34,7 +34,7 @@ - name: Undo gui-static-wan by requesting new template file set_fact: - has_WAN: False + has_WAN: False when: gui_static_wan_ip != "unset" and not gui_static_wan # figure out more than one interfaces to detect. @@ -77,7 +77,7 @@ - name: Setting user_lan_iface for 'LanController' for single interface 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" # 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 # 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 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" - 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 - name: Add location section to config file - ini_file: dest='{{ iiab_config_file }}' - section=computed_network - option='{{ item.option }}' - value='{{ item.value }}' + ini_file: + dest: "{{ iiab_config_file }}" + section: computed_network + option: "{{ item.option }}" + value: "{{ item.value }}" with_items: - - option: 'iiab_wan_enabled' - value: '{{ iiab_wan_enabled }}' - - option: 'user_wan_iface' - value: '{{ user_wan_iface }}' - - option: 'iiab_wan_iface' - value: '{{ iiab_wan_iface }}' - - option: 'iiab_lan_enabled' - value: '{{ iiab_lan_enabled }}' - - option: 'user_lan_iface' - value: '{{ user_lan_iface }}' - - option: 'iiab_lan_iface' - value: '{{ iiab_lan_iface }}' - - option: 'iiab_network_mode' - value: '{{ iiab_network_mode }}' - - option: 'hostapd_enabled' - value: '{{ hostapd_enabled }}' - - option: 'host_ssid' - value: '{{ host_ssid }}' - - option: 'host_wifi_mode' - value: '{{ host_wifi_mode }}' - - option: 'host_channel' - value: '{{ host_channel }}' + - option: iiab_wan_enabled + value: "{{ iiab_wan_enabled }}" + - option: user_wan_iface + value: "{{ user_wan_iface }}" + - option: iiab_wan_iface + value: "{{ iiab_wan_iface }}" + - option: iiab_lan_enabled + value: "{{ iiab_lan_enabled }}" + - option: user_lan_iface + value: "{{ user_lan_iface }}" + - option: iiab_lan_iface + value: "{{ iiab_lan_iface }}" + - option: iiab_network_mode + value: "{{ iiab_network_mode }}" + - option: hostapd_enabled + value: "{{ hostapd_enabled }}" + - option: host_ssid + value: "{{ host_ssid }}" + - option: host_wifi_mode + value: "{{ host_wifi_mode }}" + - option: host_channel + value: "{{ host_channel }}"