---
- import_tasks: packages.yml
- name: Configure networking via systemd
become: true
when: omni_networking is defined
block:
- name: Create the networkd config directory
file:
path: /etc/systemd/network
state: directory
mode: 0755
- name: Make network files
template:
src: network.j2
dest: "/etc/systemd/network/{{ item.key }}.network"
mode: 0644
loop: "{{ omni_networking | dict2items }}"
- name: Make netdev files
src: netdev.j2
dest: "/etc/systemd/network/{{ item.0.key + '.' + item.1 }}.netdev"
loop: "{{ omni_networking | dict2items | subelements('value.vlans', true) }}"
- import_tasks: services.yml
- name: Symlink so systemd-resolved uses /etc/resolv.conf
dest: /etc/resolv.conf
src: /run/systemd/resolve/resolv.conf
state: link
force: true
setype: net_conf_t
- name: Symlink so /etc/resolv.conf uses systemd
dest: /etc/systemd/system/multi-user.target.wants/systemd-resolved.service
src: /usr/lib/systemd/system/systemd-resolved.service