mirror of
				https://github.com/iiab/iiab.git
				synced 2025-03-09 15:40:17 +00:00 
			
		
		
		
	adjust for 'is defined' and order
This commit is contained in:
		
							parent
							
								
									8eb4b230a0
								
							
						
					
					
						commit
						a9926e6700
					
				
					 1 changed files with 32 additions and 32 deletions
				
			
		| 
						 | 
				
			
			@ -117,12 +117,12 @@
 | 
			
		|||
#      num_lan_interfaces: "1"
 | 
			
		||||
#  when: iiab_lan_enabled and iiab_wan_enabled and num_lan_interfaces == "2" and discovered_wireless_iface != "none" and iiab_wan_iface == "none"
 | 
			
		||||
 | 
			
		||||
# if there is more than one the last one wins
 | 
			
		||||
# Select an adapter that is not WAN and not wireless
 | 
			
		||||
# if there is more than one the last one wins
 | 
			
		||||
- name: Set discovered_wired_iface fact if present
 | 
			
		||||
  set_fact:
 | 
			
		||||
      discovered_wired_iface: "{{ item|trim }}"
 | 
			
		||||
  when: item|trim != discovered_wireless_iface and item|trim != discovered_wan_iface
 | 
			
		||||
  when: item|trim != discovered_wireless_iface
 | 
			
		||||
  with_items:
 | 
			
		||||
      - "{{ lan_list_result.stdout_lines }}"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -141,31 +141,31 @@
 | 
			
		|||
# moved to detected_redhat
 | 
			
		||||
 | 
			
		||||
# use value only if present
 | 
			
		||||
- name: For Debian, always use bridging - except RPi
 | 
			
		||||
  set_fact:
 | 
			
		||||
      iiab_lan_iface: br0
 | 
			
		||||
  when: discovered_wired_iface != "none" and num_lan_interfaces >= 1 and is_debuntu and not is_rpi
 | 
			
		||||
 | 
			
		||||
- name: WiFi is on the LAN - use bridging - except RPi
 | 
			
		||||
  set_fact:
 | 
			
		||||
      iiab_lan_iface: br0
 | 
			
		||||
  when: iiab_wireless_lan_iface != "none" and not is_rpi
 | 
			
		||||
 | 
			
		||||
- name: Setting wired LAN as only interface - RPi
 | 
			
		||||
  set_fact:
 | 
			
		||||
      iiab_lan_iface: "{{ iiab_wired_lan_iface }}"
 | 
			
		||||
  when: iiab_wired_lan_iface is defined and num_lan_interfaces == 1 and is_rpi
 | 
			
		||||
 | 
			
		||||
- name: Setting wireless LAN as only interface - RPi
 | 
			
		||||
  set_fact:
 | 
			
		||||
      iiab_lan_iface: "{{ iiab_wireless_lan_iface }}"
 | 
			
		||||
  when: iiab_wireless_lan_iface is defined and num_lan_interfaces == 1 and is_rpi
 | 
			
		||||
 | 
			
		||||
- name: 2 or more devices on the LAN - use bridging
 | 
			
		||||
  set_fact:
 | 
			
		||||
      iiab_lan_iface: br0
 | 
			
		||||
  when: num_lan_interfaces >= 2 and not is_rpi
 | 
			
		||||
 | 
			
		||||
- name: For Debian, always use bridging - except RPi
 | 
			
		||||
  set_fact:
 | 
			
		||||
      iiab_lan_iface: br0
 | 
			
		||||
  when: num_lan_interfaces >= 1 and is_debuntu and not is_rpi
 | 
			
		||||
 | 
			
		||||
- name: WiFi is on the LAN - use bridging - except RPi
 | 
			
		||||
  set_fact:
 | 
			
		||||
      iiab_lan_iface: br0
 | 
			
		||||
  when: not is_rpi and iiab_wireless_lan_iface is defined
 | 
			
		||||
 | 
			
		||||
- name: Setting wired LAN as only interface - RPi
 | 
			
		||||
  set_fact:
 | 
			
		||||
      iiab_lan_iface: "{{ iiab_wired_lan_iface }}"
 | 
			
		||||
  when: is_rpi and iiab_wired_lan_iface is defined
 | 
			
		||||
 | 
			
		||||
- name: Setting wireless LAN as only interface - RPi
 | 
			
		||||
  set_fact:
 | 
			
		||||
      iiab_lan_iface: "{{ iiab_wireless_lan_iface }}"
 | 
			
		||||
  when: is_rpi and iiab_wireless_lan_iface is defined
 | 
			
		||||
 | 
			
		||||
- name: in VM disable LAN - needs local_vars entry to activate
 | 
			
		||||
  set_fact:
 | 
			
		||||
      iiab_lan_iface: none
 | 
			
		||||
| 
						 | 
				
			
			@ -189,10 +189,12 @@
 | 
			
		|||
  with_items:
 | 
			
		||||
  - option: 'has_ifcfg_gw'
 | 
			
		||||
    value: '{{ has_ifcfg_gw }}'
 | 
			
		||||
  - option: 'discovered_wan_iface'
 | 
			
		||||
    value: '{{ discovered_wan_iface }}'
 | 
			
		||||
  - option: 'prior_gateway_(device_gw2)'
 | 
			
		||||
    value: '{{ device_gw2 }}'
 | 
			
		||||
  - option: 'dhcpcd_result'
 | 
			
		||||
    value: '{{ dhcpcd_result }}'
 | 
			
		||||
  - option: 'wan_in_interfaces'
 | 
			
		||||
    value: '{{ wan_in_interfaces }}'
 | 
			
		||||
  - option: 'wireless_list_1(wifi1)'
 | 
			
		||||
    value: '{{ wifi1 }}'
 | 
			
		||||
  - option: 'wireless_list_2(wifi2)'
 | 
			
		||||
| 
						 | 
				
			
			@ -201,17 +203,15 @@
 | 
			
		|||
    value: '{{ num_wifi_interfaces }}'
 | 
			
		||||
  - option: 'discovered_wireless_iface'
 | 
			
		||||
    value: '{{ discovered_wireless_iface }}'
 | 
			
		||||
  - option: 'iiab_wireless_lan_iface'
 | 
			
		||||
    value: '{{ iiab_wireless_lan_iface }}'
 | 
			
		||||
  - option: 'num_lan_interfaces'
 | 
			
		||||
    value: '{{ num_lan_interfaces }}'
 | 
			
		||||
  - option: 'discovered_wired_iface'
 | 
			
		||||
    value: '{{ discovered_wired_iface }}'
 | 
			
		||||
#  - option: 'iiab_wireless_lan_iface'
 | 
			
		||||
#    value: '{{ iiab_wireless_lan_iface }}'
 | 
			
		||||
  - option: 'num_lan_interfaces'
 | 
			
		||||
    value: '{{ num_lan_interfaces }}'
 | 
			
		||||
  - option: 'gui_static_wan'
 | 
			
		||||
    value: '{{ gui_static_wan }}'
 | 
			
		||||
  - option: 'dhcpcd_result'
 | 
			
		||||
    value: '{{ dhcpcd_result }}'
 | 
			
		||||
  - option: 'wan_in_interfaces'
 | 
			
		||||
    value: '{{ wan_in_interfaces }}'
 | 
			
		||||
  - option: 'iiab_lan_iface'
 | 
			
		||||
    value: '{{ iiab_lan_iface }}'
 | 
			
		||||
  - option: 'iiab_wan_iface'
 | 
			
		||||
    value: '{{ iiab_wan_iface }}'
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue