# roles/dhcp/tasks/default-fix.yml
# This playbook adjusts a required dhcp package "default" file,
# specific to debian-like installs
---

- name: Defaults fix | Set a default listening interface
  become: true
  lineinfile:
    dest: /etc/default/isc-dhcp-server
    line: 'INTERFACESv4="{{ dhcp_interfaces | default(ansible_default_ipv4.interface) }}"'
    regexp: '^INTERFACESv4='
  tags: dhcp
