homelab/metal/roles/systemd-networkd/tasks/main.yaml

28 lines
645 B
YAML
Raw Permalink Normal View History

2023-03-15 23:26:25 +01:00
- name: "Configure systemd-networkd"
become: true
block:
- name: "Render network config"
template:
src: default.network.j2
dest: "/etc/systemd/network/default.network"
mode: 0644
- name: "Enable systemd-networkd"
ansible.builtin.systemd:
name: systemd-networkd
enabled: true
- name: "Remove /etc/network"
ansible.builtin.file:
path: /etc/network
state: absent
- name: "Reboot with systemd-networkd configured"
ansible.builtin.reboot:
reboot_timeout: 180
- name: "Remove ifupdown"
ansible.builtin.apt:
name: ifupdown
state: absent
purge: true