mirror of
				https://github.com/iiab/iiab.git
				synced 2025-03-09 15:40:17 +00:00 
			
		
		
		
	Merge pull request #553 from jvonau/U17
U17: 18.04 daily builds with a desktop have NetworkManager installed.
This commit is contained in:
		
						commit
						27a2336c61
					
				
					 9 changed files with 81 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -32,7 +32,6 @@
 | 
			
		|||
    - libnss-mdns
 | 
			
		||||
    - avahi-daemon
 | 
			
		||||
    - avahi-discover
 | 
			
		||||
    - ifupdown 
 | 
			
		||||
    - exfat-fuse
 | 
			
		||||
    - exfat-utils
 | 
			
		||||
  when: is_debuntu
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,6 +4,7 @@ wireless_lan_present: False
 | 
			
		|||
strict_networking: False
 | 
			
		||||
iiab_demo_mode: False
 | 
			
		||||
gui_static_wan: False
 | 
			
		||||
has_NM: False
 | 
			
		||||
 | 
			
		||||
# Set defaults for discovery process as strings
 | 
			
		||||
wifi1: "not found-1"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -37,7 +37,7 @@
 | 
			
		|||
- name: Copy the bridge script
 | 
			
		||||
  template: dest=/etc/network/interfaces.d/iiab
 | 
			
		||||
            src=network/systemd.j2
 | 
			
		||||
  when: not is_rpi and (iiab_lan_iface == "br0" or wan_ip != "dhcp")
 | 
			
		||||
  when: not is_rpi and not has_NM and (iiab_lan_iface == "br0" or wan_ip != "dhcp")
 | 
			
		||||
 | 
			
		||||
- name: Copy the bridge script for RPi
 | 
			
		||||
  template: dest=/etc/network/interfaces.d/iiab
 | 
			
		||||
| 
						 | 
				
			
			@ -57,6 +57,34 @@
 | 
			
		|||
  service: name=dnsmasq state=stopped
 | 
			
		||||
  when: dnsmasq_install
 | 
			
		||||
 | 
			
		||||
# do this
 | 
			
		||||
#- name: Copy NetworkManager.conf for has_NM
 | 
			
		||||
#  template: dest=/etc/NetworkManager/NetworkManager.conf
 | 
			
		||||
#            src=network/NetworkManager.conf
 | 
			
		||||
#  when: has_NM and iiab_lan_iface == "br0"
 | 
			
		||||
 | 
			
		||||
#- name: Copy the bridge script for has_NM
 | 
			
		||||
#  template: dest=/etc/network/interfaces
 | 
			
		||||
#            src=network/systemd.j2
 | 
			
		||||
#  when: has_NM and not wan_in_interfaces and iiab_lan_iface == "br0"
 | 
			
		||||
 | 
			
		||||
# or provide keyfile layout like the XO's used way back.
 | 
			
		||||
- name: Create uuid for NM
 | 
			
		||||
  shell: uuidgen
 | 
			
		||||
  register: uuid_response
 | 
			
		||||
  when: has_NM and not wan_in_interfaces and iiab_lan_iface == "br0"
 | 
			
		||||
 | 
			
		||||
- name: Put the uuid in place
 | 
			
		||||
  set_fact:
 | 
			
		||||
    gen_uuid: "{{ uuid_response.stdout_lines[0] }}"
 | 
			
		||||
  when: has_NM and not wan_in_interfaces and iiab_lan_iface == "br0"
 | 
			
		||||
 | 
			
		||||
# NM might have a watcher on this path and we don't have to restart NM
 | 
			
		||||
- name: Copy the bridge script for has_NM
 | 
			
		||||
  template: dest=/etc/NetworkManager/system-connections/
 | 
			
		||||
            src=network/bridge-br0
 | 
			
		||||
  when: has_NM and not wan_in_interfaces and iiab_lan_iface == "br0"
 | 
			
		||||
 | 
			
		||||
- name: Reload systemd
 | 
			
		||||
  shell: systemctl daemon-reload
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -67,7 +95,7 @@
 | 
			
		|||
 | 
			
		||||
- name: Restart the networking service
 | 
			
		||||
  service: name=networking  state=restarted
 | 
			
		||||
  when: not nobridge is defined and not no_net_restart
 | 
			
		||||
  when: not nobridge is defined and not has_NM and not no_net_restart
 | 
			
		||||
  
 | 
			
		||||
- name: Restart hostapd when WiFi is present
 | 
			
		||||
  service: name=hostapd state=restarted
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -98,7 +98,7 @@
 | 
			
		|||
# LAN - pick non WAN's
 | 
			
		||||
- name: Create list of LAN (non WAN) ifaces
 | 
			
		||||
  shell: ls /sys/class/net | grep -v -e wwlan -e ppp -e lo -e br0 -e tun -e {{ device_gw }} -e {{ ap_device }}
 | 
			
		||||
  when: num_lan_interfaces != 0
 | 
			
		||||
  when: num_lan_interfaces != "0"
 | 
			
		||||
  register: lan_list_result
 | 
			
		||||
 | 
			
		||||
# If 2 interfaces found in gateway mode, with one wifi, declare other to be wan
 | 
			
		||||
| 
						 | 
				
			
			@ -114,7 +114,7 @@
 | 
			
		|||
- name: Set discovered_wired_iface fact if present
 | 
			
		||||
  set_fact:
 | 
			
		||||
      discovered_wired_iface: "{{ item|trim }}"
 | 
			
		||||
  when: item|trim != discovered_wireless_iface and lan_list_result is defined
 | 
			
		||||
  when: lan_list_result.stdout_lines is defined and item|trim != discovered_wireless_iface
 | 
			
		||||
  with_items:
 | 
			
		||||
      - "{{ lan_list_result.stdout_lines }}"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										8
									
								
								roles/network/templates/network/NetworkManager.conf
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								roles/network/templates/network/NetworkManager.conf
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,8 @@
 | 
			
		|||
[main]
 | 
			
		||||
plugins=ifupdown,keyfile
 | 
			
		||||
 | 
			
		||||
[ifupdown]
 | 
			
		||||
managed=true
 | 
			
		||||
 | 
			
		||||
[device]
 | 
			
		||||
wifi.scan-rand-mac-address=no
 | 
			
		||||
							
								
								
									
										16
									
								
								roles/network/templates/network/bridge-br0
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								roles/network/templates/network/bridge-br0
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,16 @@
 | 
			
		|||
[connection]
 | 
			
		||||
id=bridge-br0
 | 
			
		||||
uuid={{ gen_uuid }}
 | 
			
		||||
type=bridge
 | 
			
		||||
interface-name=br0
 | 
			
		||||
permissions=
 | 
			
		||||
 | 
			
		||||
[ipv4]
 | 
			
		||||
address1={{ iiab_lan_ip }}/19
 | 
			
		||||
dns-search={{ iiab_domain }}
 | 
			
		||||
method=manual
 | 
			
		||||
 | 
			
		||||
[ipv6]
 | 
			
		||||
addr-gen-mode=stable-privacy
 | 
			
		||||
dns-search=
 | 
			
		||||
method=auto
 | 
			
		||||
| 
						 | 
				
			
			@ -14,6 +14,7 @@ case $OS_VER in
 | 
			
		|||
"debian-9"  | \
 | 
			
		||||
"ubuntu-16" | \
 | 
			
		||||
"ubuntu-17" | \
 | 
			
		||||
"ubuntu-18" | \
 | 
			
		||||
"centos-7"  | \
 | 
			
		||||
"raspbian-8"| \
 | 
			
		||||
"raspbian-9")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,5 +1,6 @@
 | 
			
		|||
is_debuntu: True
 | 
			
		||||
is_ubuntu: True
 | 
			
		||||
has_NM: True
 | 
			
		||||
dns_service: bind9
 | 
			
		||||
dns_user: bind
 | 
			
		||||
dhcp_service: isc-dhcp-server
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										22
									
								
								vars/ubuntu-18.yml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								vars/ubuntu-18.yml
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,22 @@
 | 
			
		|||
is_debuntu: True
 | 
			
		||||
is_ubuntu: True
 | 
			
		||||
has_NM: True
 | 
			
		||||
dns_service: bind9
 | 
			
		||||
dns_user: bind
 | 
			
		||||
dhcp_service: isc-dhcp-server
 | 
			
		||||
proxy: squid
 | 
			
		||||
proxy_user: proxy
 | 
			
		||||
apache_service: apache2
 | 
			
		||||
apache_user: www-data
 | 
			
		||||
apache_config_dir: apache2/sites-available
 | 
			
		||||
apache_log_dir: /var/log/apache2
 | 
			
		||||
smb_service: smbd
 | 
			
		||||
nmb_service: nmbd
 | 
			
		||||
systemctl_program: /bin/systemctl
 | 
			
		||||
# issue raised 
 | 
			
		||||
mysql_service: mysql
 | 
			
		||||
apache_log: /var/log/apache2/access.log
 | 
			
		||||
sshd_service: ssh
 | 
			
		||||
php_version: 7.1
 | 
			
		||||
postgresql_version: 9.6
 | 
			
		||||
systemd_location: /lib/systemd/system
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue