---
# temporary disable network manager
# in future network manager will be used for wifi sticks
- name: Disable Networkmanager
  ansible.builtin.systemd:
    name: NetworkManager.service
      #state: stopped
    enabled: False

      #- name: Use iwd but ignore wlan interfaces in NetworkManager
      #  blockinfile:
      #    dest: /etc/NetworkManager/NetworkManager.conf
      #    block: |
      #      [device]
      #      wifi.backend=iwd
      #      match-device=interface-name:en*
      #      managed=0

- name: Configure systemd-networkd virbr1.netdev
  ansible.builtin.copy:
    dest: /etc/systemd/network/30-virbr1.netdev
    content: |
       [NetDev]
       Name=virbr1
       Kind=bridge

- name: Configure systemd-networkd ethernet.network
  ansible.builtin.copy:
    dest: /etc/systemd/network/40-ethernet.network
    content: |
       [Match]
       Name=en*
       [Network]
       Bridge=virbr1

- name: Configure systemd-networkd virbr1.network
  ansible.builtin.copy:
    dest: /etc/systemd/network/50-virbr1.network
    content: |
       [Match]
       Name=virbr1
       [Network]
       DHCP=yes
       [DHCPv4]
       UseDomains=true
       RouteMetric=512
