2017-11-23 03:15:22 +00:00
|
|
|
# sysd-netd-debian.yml
|
|
|
|
- name: Copy the bridge script - Creates br0
|
|
|
|
template:
|
|
|
|
dest: /etc/systemd/network/IIAB-Bridge.netdev
|
|
|
|
src: network/systemd-br0.j2
|
2018-05-02 23:39:53 +00:00
|
|
|
when: iiab_lan_iface == "br0"
|
2017-11-23 03:15:22 +00:00
|
|
|
|
|
|
|
- name: Copy the bridge script - Assigns IP address
|
|
|
|
template:
|
|
|
|
dest: /etc/systemd/network/IIAB-Bridge.network
|
|
|
|
src: network/systemd-br0-network.j2
|
2018-05-02 23:39:53 +00:00
|
|
|
when: iiab_lan_iface == "br0"
|
2017-11-23 03:15:22 +00:00
|
|
|
|
|
|
|
- name: Copy the bridge script - Assigns br0 wired slaves
|
|
|
|
template:
|
|
|
|
dest: /etc/systemd/network/IIAB-Slave.network
|
|
|
|
src: network/systemd-br0-slave.j2
|
2018-05-02 23:39:53 +00:00
|
|
|
when: iiab_wired_lan_iface is defined and iiab_lan_iface == "br0"
|
2017-11-23 03:15:22 +00:00
|
|
|
|
|
|
|
- name: Stopping services
|
|
|
|
include_tasks: down-debian.yml
|
|
|
|
|
2018-05-03 12:51:25 +00:00
|
|
|
- name: Disable and mask systemd-networkd-wait-online
|
|
|
|
systemd:
|
|
|
|
name: systemd-networkd-wait-online
|
|
|
|
enabled: no
|
|
|
|
masked: yes
|
|
|
|
state: stopped
|
|
|
|
when: is_ubuntu_18
|
|
|
|
|
2018-05-12 22:08:07 +00:00
|
|
|
- name: Static IP computing CIDR
|
|
|
|
shell: netmask {{ wan_ip }}/{{ wan_netmask }} | awk -F "/" '{print $2}'
|
|
|
|
register: CIDR
|
2018-05-13 04:10:41 +00:00
|
|
|
when: wan_ip != "dhcp"
|
|
|
|
|
|
|
|
- name: Static IP setting CIDR
|
|
|
|
set_fact:
|
|
|
|
wan_cidr: "{{ CIDR.stdout }}"
|
|
|
|
when: wan_ip != "dhcp"
|
2018-05-12 22:08:07 +00:00
|
|
|
|
2018-05-13 03:21:06 +00:00
|
|
|
# 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.
|
2018-05-12 22:08:07 +00:00
|
|
|
- name: Supply static template
|
|
|
|
template:
|
|
|
|
dest: /etc/netplan/50-cloud-init.yaml
|
|
|
|
src: network/cloud-init.j2
|
2018-05-13 03:21:06 +00:00
|
|
|
backup: no
|
|
|
|
when: wan_ip != "dhcp" or gui_static_wan_ip == "undefined"
|
2018-05-12 22:08:07 +00:00
|
|
|
|
2017-11-23 03:15:22 +00:00
|
|
|
- name: Reload systemd
|
2018-04-07 21:45:04 +00:00
|
|
|
systemd:
|
|
|
|
daemon_reload: yes
|
2017-11-23 03:15:22 +00:00
|
|
|
|
|
|
|
- name: Restart the systemd-networkd service
|
2018-04-07 21:45:04 +00:00
|
|
|
systemd:
|
2017-11-23 03:15:22 +00:00
|
|
|
name: systemd-networkd
|
|
|
|
enabled: yes
|
|
|
|
state: restarted
|
|
|
|
when: not nobridge is defined and not no_net_restart
|