1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-15 04:32:11 +00:00

allow the console to back out of static

This commit is contained in:
Jerry Vonau 2018-05-12 22:21:06 -05:00
parent db2b3b7ee1
commit 1082dd2aa4
2 changed files with 16 additions and 2 deletions

View file

@ -33,12 +33,16 @@
when: wan_ip != "dhcp"
register: CIDR
# 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.
- name: Supply static template
template:
dest: /etc/netplan/50-cloud-init.yaml
src: network/cloud-init.j2
backup: yes
when: wan_ip != "dhcp"
backup: no
when: wan_ip != "dhcp" or gui_static_wan_ip == "undefined"
- name: Reload systemd
systemd:

View file

@ -1,3 +1,4 @@
{% if wan_ip != "dhcp" %}
network:
ethernets:
{{ iiab_wan_iface }}:
@ -9,3 +10,12 @@ network:
addresses: [{{ wan_nameserver }}]
optional: true
version: 2
{% else %}
network:
ethernets:
{{ iiab_wan_iface }}:
addresses: []
dhcp4: true
optional: true
version: 2
{% endif %}