from durable.lang import * class Dns: @staticmethod def a(key: str, fqdn: str): return {"type": "dns-entry", "key": key, "fqdn": fqdn, "rrType": "A" } class Machine: @staticmethod def make(name: str): return {"type": "machine", "key": name, "name": name} @staticmethod def declare_rules(): @when_all((m.type == "machine")) def acmeApp(c): c.assert_fact(Dns.a(c.m.key, f"{c.m.name}.machine.acme.corp"))