1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

netplan systemd-networkd static support

This commit is contained in:
Jerry Vonau 2018-05-12 17:08:07 -05:00
parent 9c5ad99448
commit db2b3b7ee1
3 changed files with 24 additions and 0 deletions

View file

@ -61,6 +61,7 @@
- bzip2
- i2c-tools
- bridge-utils
- netmask
- usbutils
- hostapd
- wget

View file

@ -28,6 +28,18 @@
state: stopped
when: is_ubuntu_18
- name: Static IP computing CIDR
shell: netmask {{ wan_ip }}/{{ wan_netmask }} | awk -F "/" '{print $2}'
when: wan_ip != "dhcp"
register: CIDR
- name: Supply static template
template:
dest: /etc/netplan/50-cloud-init.yaml
src: network/cloud-init.j2
backup: yes
when: wan_ip != "dhcp"
- name: Reload systemd
systemd:
daemon_reload: yes

View file

@ -0,0 +1,11 @@
network:
ethernets:
{{ iiab_wan_iface }}:
dhcp4: false
dhcp6: false
addresses: [{{ wan_ip }}/{{ CIDR.stdout }}]
gateway4: {{ wan_gateway }}
nameservers:
addresses: [{{ wan_nameserver }}]
optional: true
version: 2