mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
NM support
This commit is contained in:
parent
e762dd3d8d
commit
e1e9108ac4
3 changed files with 68 additions and 0 deletions
37
roles/network/tasks/NM-debian.yml
Normal file
37
roles/network/tasks/NM-debian.yml
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
# NM-debian.yml
|
||||||
|
- include_tasks: down-debian.yml
|
||||||
|
# provide keyfile layout like the XO's used way back.
|
||||||
|
- name: Create uuid for NM
|
||||||
|
shell: uuidgen
|
||||||
|
register: uuid_response
|
||||||
|
|
||||||
|
- name: Put the uuid in place
|
||||||
|
set_fact:
|
||||||
|
gen_uuid: "{{ uuid_response.stdout_lines[0] }}"
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
- name: Reload systemd
|
||||||
|
shell: systemctl daemon-reload
|
||||||
|
|
||||||
|
- name: Restart the networking service
|
||||||
|
service:
|
||||||
|
name: network-manager
|
||||||
|
state: restarted
|
||||||
|
when: not nobridge is defined and not no_net_restart
|
||||||
|
|
||||||
|
- name: Restart hostapd when WiFi is present
|
||||||
|
service:
|
||||||
|
name: hostapd
|
||||||
|
state: restarted
|
||||||
|
when: iiab_wireless_lan_iface is defined and hostapd_enabled and iiab_network_mode != "Appliance"
|
||||||
|
|
||||||
|
- name: dhcp_server may be affected - starting - user choice
|
||||||
|
service:
|
||||||
|
name: "{{ dhcp_service2 }}"
|
||||||
|
state: started
|
||||||
|
when: iiab_network_mode != "Appliance"
|
25
roles/network/tasks/down-debian.yml
Normal file
25
roles/network/tasks/down-debian.yml
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
# down-debian.yml
|
||||||
|
|
||||||
|
#- name: Supply resolvconf.conf
|
||||||
|
# template:
|
||||||
|
# dest: /etc/resolvconf.conf
|
||||||
|
# src: network/resolvconf.j2
|
||||||
|
|
||||||
|
- name: bind may be affected
|
||||||
|
service:
|
||||||
|
name: "{{ dns_service }}"
|
||||||
|
state: stopped
|
||||||
|
when: named_install and dnsmasq_enabled
|
||||||
|
|
||||||
|
# dhcpd_server release the interface
|
||||||
|
- name: dhcpd_server may be affected - stopping dhcpd
|
||||||
|
service:
|
||||||
|
name: dhcpd
|
||||||
|
state: stopped
|
||||||
|
when: dhcpd_install
|
||||||
|
|
||||||
|
- name: dhcpd_server may be affected - stopping dnsmasq
|
||||||
|
service:
|
||||||
|
name: dnsmasq
|
||||||
|
state: stopped
|
||||||
|
when: dnsmasq_install
|
|
@ -90,6 +90,12 @@
|
||||||
- network
|
- network
|
||||||
when: is_redhat and not installing
|
when: is_redhat and not installing
|
||||||
|
|
||||||
|
- include_tasks: NM-debian.yml
|
||||||
|
tags:
|
||||||
|
- network
|
||||||
|
when: is_debuntu and has_NM
|
||||||
|
#and not installing
|
||||||
|
|
||||||
- include_tasks: debian.yml
|
- include_tasks: debian.yml
|
||||||
tags:
|
tags:
|
||||||
- network
|
- network
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue