--- - name: create netplan conf-available directory file: path: /etc/netplan/conf-available state: directory - name: install netplan configs template: src: "netplan/{{ item }}.yaml.j2" dest: "/etc/netplan/conf-available/{{ item }}.yaml" with_items: - lan-only - r3 - r3-with-lan # - festival # - elevate-office # - dhcp notify: netplan apply - name: remove default netplan config file: path: /etc/netplan/01-netcfg.yaml state: absent notify: netplan apply - name: set active netwok setup file: state: link dest: /etc/netplan/01-active.yaml src: "conf-available/{{ network_setup }}.yaml" notify: netplan apply - name: make sure network config has been applied meta: flush_handlers