1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00
iiab/roles/network/tasks/NM-debian.yml

80 lines
2.1 KiB
YAML
Raw Normal View History

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
mode: 0600
when: iiab_network_mode != "Appliance"
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"
- 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"
- 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
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
systemd:
2017-11-23 02:26:23 +00:00
name: network-manager
state: restarted
when: not nobridge is defined and not no_net_restart