2017-11-23 02:26:23 +00:00
|
|
|
# NM-debian.yml
|
2017-11-23 02:30:10 +00:00
|
|
|
- name: Stopping services
|
|
|
|
include_tasks: down-debian.yml
|
|
|
|
|
2017-11-23 02:26:23 +00:00
|
|
|
# provide keyfile layout like the XO's used way back.
|
2017-11-23 07:28:36 +00:00
|
|
|
- name: Create uuid for NM's keyfile store
|
2017-11-23 02:26:23 +00:00
|
|
|
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
|
2017-11-23 07:28:36 +00:00
|
|
|
- name: Copy the bridge script for NetworkManager
|
2017-11-23 02:26:23 +00:00
|
|
|
template:
|
|
|
|
dest: /etc/NetworkManager/system-connections/
|
|
|
|
src: network/bridge-br0
|
2018-03-26 04:59:09 +00:00
|
|
|
mode: 0600
|
2018-05-14 01:50:37 +00:00
|
|
|
when: iiab_network_mode != "Appliance"
|
2018-03-26 04:59:09 +00:00
|
|
|
|
2018-05-02 17:38:09 +00:00
|
|
|
- name: Remove br0 in Appliance Mode for NetworkManager
|
|
|
|
file:
|
|
|
|
dest: /etc/NetworkManager/system-connections/bridge-br0
|
|
|
|
state: absent
|
|
|
|
when: iiab_network_mode == "Appliance"
|
|
|
|
|
2018-05-14 01:50:37 +00:00
|
|
|
- name: Removing static for NetworkManager
|
|
|
|
file:
|
|
|
|
dest: /etc/NetworkManager/system-connections/iiab-static
|
|
|
|
state: absent
|
|
|
|
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: Create uuid for NM's keyfile store static
|
|
|
|
shell: uuidgen
|
|
|
|
register: uuid_response2
|
|
|
|
when: wan_ip != "dhcp"
|
|
|
|
|
|
|
|
- name: Put the uuid in place
|
|
|
|
set_fact:
|
|
|
|
gen_uuid2: "{{ uuid_response2.stdout_lines[0] }}"
|
|
|
|
when: wan_ip != "dhcp"
|
|
|
|
|
|
|
|
- name: Copy static template for NetworkManager
|
|
|
|
template:
|
|
|
|
dest: /etc/NetworkManager/system-connections/iiab-static
|
|
|
|
src: network/NM-static.j2
|
|
|
|
mode: 0600
|
|
|
|
when: wan_ip != "dhcp"
|
|
|
|
|
2018-03-26 04:59:09 +00:00
|
|
|
- name: Stop wpa_supplicant service
|
|
|
|
service:
|
|
|
|
name: wpa_supplicant
|
|
|
|
state: stopped
|
|
|
|
when: iiab_wireless_lan_iface is defined and hostapd_enabled and iiab_network_mode != "Appliance"
|
|
|
|
|
|
|
|
- name: Mask wpa_supplicant
|
|
|
|
shell: systemctl mask wpa_supplicant
|
|
|
|
when: iiab_wireless_lan_iface is defined and hostapd_enabled and iiab_network_mode != "Appliance"
|
2017-11-23 02:26:23 +00:00
|
|
|
|
|
|
|
- name: Reload systemd
|
2018-04-07 21:45:04 +00:00
|
|
|
systemd:
|
|
|
|
daemon_reload: yes
|
2017-11-23 02:26:23 +00:00
|
|
|
|
2017-11-23 07:28:36 +00:00
|
|
|
- name: Restart the NetworkManager service
|
2018-04-07 21:45:04 +00:00
|
|
|
systemd:
|
2017-11-23 02:26:23 +00:00
|
|
|
name: network-manager
|
|
|
|
state: restarted
|
|
|
|
when: not nobridge is defined and not no_net_restart
|