- name: Copy systemd.network(5) configuration template: src=etc/systemd/network/01-wired.network.j2 dest=/etc/systemd/network/01-wired.network owner=root group=root mode=0644 notify: - Restart systemd-networkd - name: Start systemd-networkd service: name=systemd-networkd.service enabled=true state=started - meta: flush_handlers - name: Remove ifupdown and isc-dhcp-* apt: pkg={{ packages }} state=absent purge=yes vars: packages: - ifupdown - isc-dhcp-client - isc-dhcp-common - name: Remove /etc/network/interfaces and /etc/network/interfaces.d file: path={{ item }} state=absent with_items: - /etc/network/interfaces - /etc/network/interfaces.d/ - name: Install systemd-resolved apt: pkg={{ packages }} vars: packages: - systemd-resolved - libnss-resolve - libnss-myhostname - name: Create directory /etc/systemd/resolved.conf.d file: path=/etc/systemd/resolved.conf.d state=directory owner=root group=root mode=0755 - name: Configure systemd-resolved copy: src=etc/systemd/resolved.conf.d/local.conf dest=/etc/systemd/resolved.conf.d/local.conf owner=root group=root mode=0644 notify: - Restart systemd-resolved - name: Start systemd-resolved service: name=systemd-resolved.service enabled=true state=started - meta: flush_handlers - name: Remove resolvconf apt: pkg=resolvconf state=absent purge=yes - name: Install systemd-timesyncd apt: pkg=systemd-timesyncd - name: Create directory /etc/systemd/timesyncd.conf.d file: path=/etc/systemd/timesyncd.conf.d state=directory owner=root group=root mode=0755 - name: Configure systemd-timesyncd copy: src=etc/systemd/timesyncd.conf.d/local.conf dest=/etc/systemd/timesyncd.conf.d/local.conf owner=root group=root mode=0644 notify: - Restart systemd-timesyncd - name: Start systemd-timesyncd service: name=systemd-timesyncd.service enabled=true state=started - meta: flush_handlers - name: Remove ntp apt: pkg={{ packages }} state=absent purge=yes vars: packages: - ntp - ntpdate - ntpsec - ntpsec-ntpdate