mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
allow the console to back out of static
This commit is contained in:
parent
db2b3b7ee1
commit
1082dd2aa4
2 changed files with 16 additions and 2 deletions
|
@ -33,12 +33,16 @@
|
||||||
when: wan_ip != "dhcp"
|
when: wan_ip != "dhcp"
|
||||||
register: CIDR
|
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
|
- name: Supply static template
|
||||||
template:
|
template:
|
||||||
dest: /etc/netplan/50-cloud-init.yaml
|
dest: /etc/netplan/50-cloud-init.yaml
|
||||||
src: network/cloud-init.j2
|
src: network/cloud-init.j2
|
||||||
backup: yes
|
backup: no
|
||||||
when: wan_ip != "dhcp"
|
when: wan_ip != "dhcp" or gui_static_wan_ip == "undefined"
|
||||||
|
|
||||||
- name: Reload systemd
|
- name: Reload systemd
|
||||||
systemd:
|
systemd:
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
{% if wan_ip != "dhcp" %}
|
||||||
network:
|
network:
|
||||||
ethernets:
|
ethernets:
|
||||||
{{ iiab_wan_iface }}:
|
{{ iiab_wan_iface }}:
|
||||||
|
@ -9,3 +10,12 @@ network:
|
||||||
addresses: [{{ wan_nameserver }}]
|
addresses: [{{ wan_nameserver }}]
|
||||||
optional: true
|
optional: true
|
||||||
version: 2
|
version: 2
|
||||||
|
{% else %}
|
||||||
|
network:
|
||||||
|
ethernets:
|
||||||
|
{{ iiab_wan_iface }}:
|
||||||
|
addresses: []
|
||||||
|
dhcp4: true
|
||||||
|
optional: true
|
||||||
|
version: 2
|
||||||
|
{% endif %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue