mirror of
				https://github.com/iiab/iiab.git
				synced 2025-03-09 15:40:17 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			78 lines
		
	
	
	
		
			2.2 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			78 lines
		
	
	
	
		
			2.2 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
| # sysd-netd-debian.yml
 | |
| - name: Copy the bridge script - Creates br0
 | |
|   template:
 | |
|     dest: /etc/systemd/network/IIAB-Bridge.netdev
 | |
|     src: network/systemd-br0.j2
 | |
|   when: iiab_lan_iface == "br0"
 | |
| 
 | |
| - name: Copy the bridge script - Assigns IP address
 | |
|   template:
 | |
|     dest: /etc/systemd/network/IIAB-Bridge.network
 | |
|     src: network/systemd-br0-network.j2
 | |
|   when: iiab_lan_iface == "br0"
 | |
| 
 | |
| # can be more than one wired interface
 | |
| - name: Wired enslaving - Assigns lan_list_results to br0 as wired slaves if present
 | |
|   template:
 | |
|     src: network/systemd-br0-slave.j2
 | |
|     dest: /etc/systemd/network/IIAB-Slave-{{ item|trim }}.network
 | |
|   with_items:
 | |
|     - "{{ lan_list_result.stdout_lines }}"
 | |
|   when: iiab_wired_lan_iface is defined and num_lan_interfaces|int >= 1 and not network_manager_active
 | |
| 
 | |
| - name: Remove static WAN template
 | |
|   file:
 | |
|     state: absent
 | |
|     dest: /etc/systemd/network/IIAB-Static.network
 | |
|   when: wan_ip == "dhcp"
 | |
| 
 | |
| - name: Static IP computing CIDR
 | |
|   shell: netmask {{ wan_ip }}/{{ wan_netmask }} | awk -F "/" '{print $2}'
 | |
|   register: CIDR
 | |
|   when: wan_ip != "dhcp"
 | |
| 
 | |
| - name: Static IP setting CIDR
 | |
|   set_fact:
 | |
|     wan_cidr: "{{ CIDR.stdout }}"
 | |
|   when: wan_ip != "dhcp"
 | |
| 
 | |
| - name: Supply static WAN template when network_manager_active is False
 | |
|   template:
 | |
|     dest: /etc/systemd/network/IIAB-Static.network
 | |
|     src: network/systemd-static-net.j2
 | |
|   when: wan_ip != "dhcp" and ( is_ubuntu_16 or not network_manager_active )
 | |
| 
 | |
|   #when: wan_ip != "dhcp" and not is_ubuntu_18
 | |
| 
 | |
| - name: Stopping services
 | |
|   include_tasks: down-debian.yml
 | |
| 
 | |
| - name: Reload systemd
 | |
|   systemd:
 | |
|     daemon_reload: yes
 | |
| 
 | |
| - name: Clone wifi if needed
 | |
|   systemd:
 | |
|     name: iiab-clone-wifi
 | |
|     state: started
 | |
|   when: wifi_up_down and discovered_wireless_iface != "none"
 | |
| 
 | |
| - name: Enable & Restart systemd-networkd.service
 | |
|   systemd:
 | |
|     name: systemd-networkd
 | |
|     state: restarted
 | |
|     enabled: yes
 | |
|     masked: no
 | |
| 
 | |
| - name: Enable & Restart networkd-dispatcher.service
 | |
|   systemd:
 | |
|     name: networkd-dispatcher
 | |
|     state: restarted
 | |
|     enabled: yes
 | |
|     masked: no
 | |
| 
 | |
| - name: Restart hostapd when WiFi is present but not when using WiFi as gateway with wifi_up_down False
 | |
|   systemd:
 | |
|     name: hostapd
 | |
|     state: restarted
 | |
|   when: hostapd_enabled and (wifi_up_down or not no_net_restart)
 |