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

handle different netplan file name

This commit is contained in:
Jerry Vonau 2018-05-20 11:57:10 -05:00
parent 5ca184297e
commit 7501d256f8

View file

@ -38,13 +38,18 @@
wan_cidr: "{{ CIDR.stdout }}"
when: wan_ip != "dhcp"
- name: Figure out netplan file name on Ubuntu 18
shell: ls /etc/netplan
register: netplan
when: is_ubuntu_18
# 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
dest: /etc/netplan/{{ netplan.stdout }}
src: network/cloud-init.j2
backup: no
when: (wan_ip != "dhcp" or gui_static_wan_ip == "undefined") and is_ubuntu_18