---
- name: Delete config to DHCP server
  ansible.builtin.lineinfile:
    path: "{{ path_dhcp_conf }}"
    state: absent
    line: 'host {{ vm_name | regex_replace("\..*","") }} { hardware ethernet  {{ vm_macaddress }}; if exists user-class and option user-class = "iPXE" { filename "http://${next-server}:80/.boot/boot_{{ vm_macaddress }}.ipxe";} else { filename "undionly.kpxe"; }}'

- name: Remove config files
  ansible.builtin.file:
    path: "{{ item }}"
    state: absent
  loop:
    - "{{ path_ipxe_boot }}/boot_{{ vm_macaddress }}.ipxe"
    - "{{ path_preseed }}/preseed_{{ vm_macaddress }}.cfg"