---
- name: Converge
  hosts: all
  become: true
  vars:
    dhcp_global_default_lease_time: 28800   # 8hrs
    dhcp_global_max_lease_time: 43200       # 12 hrs
    dhcp_global_subnet_mask: 255.255.255.0
    dhcp_global_broadcast_address: 192.168.222.255
    # dhcp_global_routers: 10.0.2.2
    dhcp_global_domain_name: example.com
    dhcp_global_domain_name_servers:
      - 8.8.8.8
      - 8.8.4.4
    dhcp_global_bootp: allow
    dhcp_global_booting: allow
    dhcp_global_next_server: 192.168.222.3
    dhcp_global_filename: boot.img

    dhcp_global_classes:
      - name: vbox
        match: 'match if binary-to-ascii(16,8,":",substring(hardware, 1, 3)) = "8:0:27"'

    dhcp_subnets:
      - ip: 192.168.222.0
        netmask: 255.255.255.128
        domain_name_servers:
          - 10.0.2.3
          - 10.0.2.4
        range_begin: 192.168.222.50
        range_end: 192.168.222.100
        pools:
          - default_lease_time: 1800
            max_lease_time: 3600
            range_begin: 192.168.222.101
            range_end: 192.168.222.127
            allow: 'members of "vbox"'
      - ip: 192.168.222.128
        default_lease_time: 3600
        max_lease_time: 7200
        netmask: 255.255.255.128
        domain_name_servers: 10.0.2.3
        routers: 192.168.222.129

    dhcp_hosts:
      - name: cl1
        mac: 'de:ad:c0:de:ca:fe'
        ip: 192.168.222.150
      - name: cl2
        mac: '00:de:ad:be:ef:00'
        ip: 192.168.222.151

    dhcp6_enable: true
    dhcp6_subnets:
      - ip: 'fdad:d155:f869:55b4::'
        cidr: 64
        range_begin: 'fdad:d155:f869:55b4::2:0000'
        range_end: 'fdad:d155:f869:55b4::2:ffff'
        default_lease_time: 1800
        max_lease_time: 7200
        hosts:
          - name: testws
            mac: '08:00:27:4c:e4:46'
            ip: 'fdad:d155:f869:55b4::3:1'
  tasks:
    - name: "Include bertvv.dhcp"
      include_role:
        name: "bertvv.dhcp"
