# Info: KCL Resolv task schemas for provisioning (Provisioning)
# Author: JesusPerezLorenzo 
# Release: 0.0.4
# Date: 31-12-2023

import regex

schema NameServer: 
    ns_ip: str
    check:
        ns_ip == Undefined or regex.match(ns_ip,"^\$.*$") or regex.match(ns_ip, "^((25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9])$"), "'ns_ip = ${ns_ip}' check value definition (use $value or xx.xx.xx.xx)"

schema Resolv:
    name: str = "resolv"
    nameservers: [NameServer]
    domains_search: str = ""
