diff --git a/roles/network/tasks/netplan.yml b/roles/network/tasks/netplan.yml index a9f977faf7..0d86638480 100644 --- a/roles/network/tasks/netplan.yml +++ b/roles/network/tasks/netplan.yml @@ -4,11 +4,9 @@ with_items: - "{{ netplan.stdout_lines }}" -- name: Remove stock netplan template - file: - state: absent - path: /etc/netplan/{{ item }} - when: netplan.stdout.find("yaml") != -1 and item|trim != "02-iiab-config.yaml" +- name: Moving 50-cloud-init.yaml to 02-iiab-config.yaml + shell: mv /etc/netplan/50-cloud-init.yaml /etc/netplan/02-iiab-config.yaml + when: netplan.stdout.find("yaml") != -1 and item|trim == "50-cloud-init.yaml" with_items: - "{{ netplan.stdout_lines }}" @@ -25,6 +23,11 @@ - systemd-networkd-wait-online when: systemd_networkd_active | bool +- name: Ensure systemd-networkd gets enabled for br0 + set_fact: + systemd_networkd_active: True + when: network_manager_active | bool and iiab_lan_iface == "br0" + # 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 @@ -39,12 +42,20 @@ wan_cidr: "{{ CIDR.stdout }}" when: wan_ip != "dhcp" -- name: Supply netplan template - template: - dest: /etc/netplan/01-iiab-config.yaml - src: network/netplan.j2 - backup: no - when: iiab_wan_iface != discovered_wireless_iface +- name: Remove stock netplan template + file: + state: absent + path: /etc/netplan/{{ item }} + when: netplan.stdout.find("yaml") != -1 and item|trim != "02-iiab-config.yaml" and wan_ip != "dhcp" + with_items: + - "{{ netplan.stdout_lines }}" + +#- name: Supply netplan template +# template: +# dest: /etc/netplan/01-iiab-config.yaml +# src: network/netplan.j2 +# backup: no +# when: iiab_wan_iface != discovered_wireless_iface and wan_ip != "dhcp" # should blow up here if we messed up the yml file #- name: Generate netplan config