mirror of
				https://github.com/iiab/iiab.git
				synced 2025-03-09 15:40:17 +00:00 
			
		
		
		
	split out netplan
This commit is contained in:
		
							parent
							
								
									77a37b5fd6
								
							
						
					
					
						commit
						93694e853b
					
				
					 2 changed files with 15 additions and 32 deletions
				
			
		| 
						 | 
				
			
			@ -104,16 +104,23 @@
 | 
			
		|||
  tags:
 | 
			
		||||
    - network
 | 
			
		||||
 | 
			
		||||
- name: Netplan in use on ubuntu 18
 | 
			
		||||
  include_tasks: netplan.yml
 | 
			
		||||
  when: is_ubuntu_18
 | 
			
		||||
#and not installing
 | 
			
		||||
  tags:
 | 
			
		||||
    - network
 | 
			
		||||
 | 
			
		||||
- name: NetworkManager in use (if ubuntu-18 and network_manager_active)
 | 
			
		||||
  include_tasks: NM-debian.yml
 | 
			
		||||
  when: is_ubuntu_18 and network_manager_active
 | 
			
		||||
  when: not is_ubuntu_18 and network_manager_active
 | 
			
		||||
#and not installing
 | 
			
		||||
  tags:
 | 
			
		||||
    - network
 | 
			
		||||
 | 
			
		||||
- name: systemd-networkd in use
 | 
			
		||||
  include_tasks: sysd-netd-debian.yml
 | 
			
		||||
  when: is_debuntu and systemd_networkd_active
 | 
			
		||||
  when: not is_ubuntu_18 and is_debuntu and systemd_networkd_active
 | 
			
		||||
#and not installing
 | 
			
		||||
  tags:
 | 
			
		||||
    - network
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -20,13 +20,11 @@
 | 
			
		|||
- name: Stopping services
 | 
			
		||||
  include_tasks: down-debian.yml
 | 
			
		||||
 | 
			
		||||
- name: Disable and mask systemd-networkd-wait-online
 | 
			
		||||
  systemd:
 | 
			
		||||
    name: systemd-networkd-wait-online
 | 
			
		||||
    enabled: no
 | 
			
		||||
    masked: yes
 | 
			
		||||
    state: stopped
 | 
			
		||||
  when: is_ubuntu_18
 | 
			
		||||
- 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}'
 | 
			
		||||
| 
						 | 
				
			
			@ -38,33 +36,11 @@
 | 
			
		|||
    wan_cidr: "{{ CIDR.stdout }}"
 | 
			
		||||
  when: wan_ip != "dhcp"
 | 
			
		||||
 | 
			
		||||
- name: Figure out netplan file name on Ubuntu 18
 | 
			
		||||
  shell: ls /etc/netplan
 | 
			
		||||
  register: netplan
 | 
			
		||||
  when: is_ubuntu_18
 | 
			
		||||
 | 
			
		||||
# ICO will always set gui_static_wan_ip away from the default of 'unset' while
 | 
			
		||||
# gui_static_wan turns dhcp on/off through wan_ip in computed_network and
 | 
			
		||||
# overrides gui_static_wan_ip that is present. Changing wan_ip in local_vars
 | 
			
		||||
# is a oneway street to static.
 | 
			
		||||
- name: Supply static template
 | 
			
		||||
  template:
 | 
			
		||||
    dest:  /etc/netplan/{{ netplan.stdout }}
 | 
			
		||||
    src: network/cloud-init.j2
 | 
			
		||||
    backup: no
 | 
			
		||||
  when: (wan_ip != "dhcp" or gui_static_wan_ip == "undefined") and is_ubuntu_18
 | 
			
		||||
 | 
			
		||||
- name: Remove static WAN template
 | 
			
		||||
  file:
 | 
			
		||||
    state: absent
 | 
			
		||||
    dest: /etc/systemd/network/IIAB-Static.network
 | 
			
		||||
  when: wan_ip == "dhcp" and not is_ubuntu_18
 | 
			
		||||
 | 
			
		||||
- name: Supply static WAN template
 | 
			
		||||
  template:
 | 
			
		||||
    dest: /etc/systemd/network/IIAB-Static.network
 | 
			
		||||
    src: network/systemd-static-net.j2
 | 
			
		||||
  when: wan_ip != "dhcp" and not is_ubuntu_18
 | 
			
		||||
  when: wan_ip != "dhcp"
 | 
			
		||||
 | 
			
		||||
- name: Reload systemd
 | 
			
		||||
  systemd:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue