fix
This commit is contained in:
@@ -23,13 +23,13 @@ locals {
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
soa-ns = <<-EOF
|
soa-ns = <<-EOF
|
||||||
@ IN SOA ${var.sub-domain}.${var.domain_name}. ${var.domain_name}. (
|
@ IN SOA ${var.sub_domain}.${var.domain_name}. ${var.domain_name}. (
|
||||||
${formatdate("YYYYMMDDhh",timestamp())} ; Serial
|
${formatdate("YYYYMMDDhh",timestamp())} ; Serial
|
||||||
4H ; Refresh
|
4H ; Refresh
|
||||||
1H ; Retry
|
1H ; Retry
|
||||||
7D ; Expire
|
7D ; Expire
|
||||||
4H ) ; Negative Cache TTL
|
4H ) ; Negative Cache TTL
|
||||||
@ IN NS ${var.sub-domain}.${var.domain_name}.
|
@ IN NS ${var.sub_domain}.${var.domain_name}.
|
||||||
EOF
|
EOF
|
||||||
files = merge({
|
files = merge({
|
||||||
"Corefile" = join("\n", concat([local.begin-core],[for z in var.zones: format("file /etc/coredns/%s.db %s", z.name,z.name)],[local.end-core]))
|
"Corefile" = join("\n", concat([local.begin-core],[for z in var.zones: format("file /etc/coredns/%s.db %s", z.name,z.name)],[local.end-core]))
|
||||||
@@ -39,15 +39,15 @@ locals {
|
|||||||
"$ORIGIN ${z.name}.",
|
"$ORIGIN ${z.name}.",
|
||||||
local.soa-ns
|
local.soa-ns
|
||||||
],
|
],
|
||||||
z.domain!=""?[format("%s. IN A %s", z.name, z.domain)]:[],
|
lookup(z, "domain","")!=""?[format("%s. IN A %s", z.name, z.domain)]:[],
|
||||||
z.domain6!=""?[format("%s. IN AAAA %s", z.name, z.domain6)]:[],
|
lookup(z, "domain6","")!=""?[format("%s. IN AAAA %s", z.name, z.domain6)]:[],
|
||||||
[for k,v in z.txt: format("%s IN TXT %s", k, v)],
|
[for k,v in lookup(z, "txt",[]): format("%s IN TXT %s", k, v)],
|
||||||
[for k,v in z.hosts: format("%s IN A %s", k, v)],
|
[for k,v in lookup(z, "hosts",[]): format("%s IN A %s", k, v)],
|
||||||
[for k,v in z.hosts6: format("%s IN AAAA %s", k, v)],
|
[for k,v in lookup(z, "hosts6",[]): format("%s IN AAAA %s", k, v)],
|
||||||
[for k,v in z.alias: format("%s IN CNAME %s", k, v)],
|
[for k,v in lookup(z, "alias",[]): format("%s IN CNAME %s", k, v)],
|
||||||
[for mx in z.mx: format("%s IN MX %d %s", mx.name, mx.priority, mx.value)],
|
[for mx in lookup(z, "mx",[]): format("%s IN MX %d %s", mx.name, mx.priority, mx.value)],
|
||||||
z.wildcard!=""?[format("*.%s. IN A %s", z.name, z.wildcard)]:[],
|
lookup(z, "wildcard","")!=""?[format("*.%s. IN A %s", z.name, z.wildcard)]:[],
|
||||||
z.wildcard6!=""?[format("*.%s. IN AAAA %s", z.name, z.wildcard6)]:[],
|
lookup(z, "wildcard6","")!=""?[format("*.%s. IN AAAA %s", z.name, z.wildcard6)]:[],
|
||||||
))
|
))
|
||||||
}]...)
|
}]...)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ metadata:
|
|||||||
name: dns
|
name: dns
|
||||||
description: null
|
description: null
|
||||||
options:
|
options:
|
||||||
domain:
|
forward:
|
||||||
default: your-company
|
default: 192.168.1.254
|
||||||
examples:
|
examples:
|
||||||
- your-company
|
- 192.168.1.254
|
||||||
type: string
|
type: string
|
||||||
sub-domain:
|
sub_domain:
|
||||||
default: dns
|
default: dns
|
||||||
examples:
|
examples:
|
||||||
- dns
|
- dns
|
||||||
@@ -21,11 +21,35 @@ options:
|
|||||||
examples:
|
examples:
|
||||||
- your_company.com
|
- your_company.com
|
||||||
type: string
|
type: string
|
||||||
forward:
|
image:
|
||||||
default: 192.168.1.254
|
default:
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
registry: docker.io
|
||||||
|
repository: coredns/coredns
|
||||||
|
tag: 1.11.1
|
||||||
examples:
|
examples:
|
||||||
- 192.168.1.254
|
- pullPolicy: IfNotPresent
|
||||||
type: string
|
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
|
||||||
zones:
|
zones:
|
||||||
default: []
|
default: []
|
||||||
items:
|
items:
|
||||||
@@ -74,35 +98,11 @@ options:
|
|||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
image:
|
domain:
|
||||||
default:
|
default: your-company
|
||||||
pullPolicy: IfNotPresent
|
|
||||||
registry: docker.io
|
|
||||||
repository: coredns/coredns
|
|
||||||
tag: 1.11.1
|
|
||||||
examples:
|
examples:
|
||||||
- pullPolicy: IfNotPresent
|
- your-company
|
||||||
registry: docker.io
|
type: string
|
||||||
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
|
|
||||||
dependencies: []
|
dependencies: []
|
||||||
providers:
|
providers:
|
||||||
kubernetes: true
|
kubernetes: true
|
||||||
|
|||||||
Reference in New Issue
Block a user