mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 11:42:08 +00:00
systemd-networkd support for wan static ip address
This commit is contained in:
parent
450a346839
commit
7d0cfc0f93
2 changed files with 24 additions and 0 deletions
|
@ -49,6 +49,18 @@
|
||||||
backup: no
|
backup: no
|
||||||
when: (wan_ip != "dhcp" or gui_static_wan_ip == "undefined") and is_ubuntu_18
|
when: (wan_ip != "dhcp" or gui_static_wan_ip == "undefined") and is_ubuntu_18
|
||||||
|
|
||||||
|
- name: Remove static WAN template
|
||||||
|
file:
|
||||||
|
state: absent
|
||||||
|
dest: /etc/systemd/network/IIAB-Static.network
|
||||||
|
when: wan_ip == "dhcp" and not is_ubuntu_18
|
||||||
|
|
||||||
|
- name: Supply static WAN template
|
||||||
|
template:
|
||||||
|
dest: /etc/systemd/network/IIAB-Static.network
|
||||||
|
src: network/systemd-static-net.j2
|
||||||
|
when: wan_ip != "dhcp" and not is_ubuntu_18
|
||||||
|
|
||||||
- name: Reload systemd
|
- name: Reload systemd
|
||||||
systemd:
|
systemd:
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
|
12
roles/network/templates/network/systemd-static-net.j2
Normal file
12
roles/network/templates/network/systemd-static-net.j2
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# /etc/systemd/network/IIAB-static.network
|
||||||
|
[Match]
|
||||||
|
Name={{ iiab_wan_iface }}
|
||||||
|
|
||||||
|
[Network]
|
||||||
|
Address={{ wan_ip }}/{{ wan_cidr }}
|
||||||
|
Gateway={{ wan_gateway }}
|
||||||
|
LinkLocalAddressing=yes
|
||||||
|
DNS={{ wan_namserver }}
|
||||||
|
Domains={{ iiab_domain }}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue