diff --git a/share/dns/config.tf b/share/dns/config.tf index c433365..c56f0df 100644 --- a/share/dns/config.tf +++ b/share/dns/config.tf @@ -39,15 +39,15 @@ locals { "$ORIGIN ${z.name}.", local.soa-ns ], - try(z.domain,"")!=""?[format("%s. IN A %s", z.name, z.domain)]:[], - try(z.domain6,"")!=""?[format("%s. IN AAAA %s", z.name, z.domain6)]:[], - [for k,v in try(z.txt,[]): format("%s IN TXT %s", k, v)], - [for k,v in try(z.hosts,[]): format("%s IN A %s", k, v)], - [for k,v in try(z.hosts6,[]): format("%s IN AAAA %s", k, v)], - [for k,v in try(z.alias,[]): format("%s IN CNAME %s", k, v)], - [for mx in try(z.mx,[]): format("%s IN MX %d %s", mx.name, mx.priority, mx.value)], - try(z.wildcard,"")!=""?[format("*.%s. IN A %s", z.name, z.wildcard)]:[], - try(z.wildcard6,"")!=""?[format("*.%s. IN AAAA %s", z.name, z.wildcard6)]:[], + z.domain!=null&&z.domain!=""?[format("%s. IN A %s", z.name, z.domain)]:[], + z.domain6!=null&&z.domain6!=""?[format("%s. IN AAAA %s", z.name, z.domain6)]:[], + z.txt==null?[]:[for k,v in z.txt: format("%s IN TXT %s", k, v)], + z.hosts==null?[]:[for k,v in z.hosts,[]: format("%s IN A %s", k, v)], + z.hosts6==null?[]:[for k,v in z.hosts6,[]: format("%s IN AAAA %s", k, v)], + z.alias==null?[]:[for k,v in z.alias,[]: format("%s IN CNAME %s", k, v)], + z.mx==null?[]:[for mx in z.mx,[]: format("%s IN MX %d %s", mx.name, mx.priority, mx.value)], + z.wildcard!=null&&z.wildcard!=""?[format("*.%s. IN A %s", z.name, z.wildcard)]:[], + z.wildcard6!=null&&z.wildcard6!=""?[format("*.%s. IN AAAA %s", z.name, z.wildcard6)]:[], )) }]...) } diff --git a/share/dns/index.yaml b/share/dns/index.yaml index 766fecc..4072ef7 100644 --- a/share/dns/index.yaml +++ b/share/dns/index.yaml @@ -6,45 +6,6 @@ metadata: name: dns description: null options: - domain: - default: your-company - examples: - - your-company - type: string - image: - default: - pullPolicy: IfNotPresent - registry: docker.io - repository: coredns/coredns - tag: 1.11.1 - examples: - - pullPolicy: IfNotPresent - registry: docker.io - repository: coredns/coredns - tag: 1.11.1 - properties: - pullPolicy: - default: IfNotPresent - enum: - - Always - - Never - - IfNotPresent - type: string - registry: - default: docker.io - type: string - repository: - default: coredns/coredns - type: string - tag: - default: 1.11.1 - type: string - type: object - forward: - default: 192.168.1.254 - examples: - - 192.168.1.254 - type: string zones: default: [] items: @@ -103,6 +64,45 @@ options: examples: - your_company.com type: string + image: + default: + pullPolicy: IfNotPresent + registry: docker.io + repository: coredns/coredns + tag: 1.11.1 + examples: + - pullPolicy: IfNotPresent + registry: docker.io + repository: coredns/coredns + tag: 1.11.1 + properties: + pullPolicy: + default: IfNotPresent + enum: + - Always + - Never + - IfNotPresent + type: string + registry: + default: docker.io + type: string + repository: + default: coredns/coredns + type: string + tag: + default: 1.11.1 + type: string + type: object + forward: + default: 192.168.1.254 + examples: + - 192.168.1.254 + type: string + domain: + default: your-company + examples: + - your-company + type: string dependencies: [] providers: kubernetes: true