mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-13 14:16:46 +00:00
Roles, playbooks, templates and scripts MUST consume the central
`NETWORK_PUBLIC_DNS_RESOLVERS` list from `group_vars/all/08_networks.yml`
instead of pasting `1.1.1.1` / `8.8.8.8` / `1.0.0.1` literally, so a
single edit propagates everywhere those resolvers are used.
- tests/lint/repository/test_no_hardcoded_dns_resolvers.py: scans the
repo for the literal IPs declared in NETWORK_PUBLIC_DNS_RESOLVERS,
fails on any occurrence not covered by `# noqa: hardcoded-dns-resolver`.
- roles/sys-svc-container/vars/main.yml: `SYS_SVC_DOCKER_AUTOMTU_TARGETS`
no longer hard-codes `1.1.1.1`; the list is now built from
`['registry-1.docker.io', 'github.com'] + NETWORK_PUBLIC_DNS_RESOLVERS`.
- roles/user/templates/bashrc.j2: `ip route get 8.8.8.8` ->
`ip route get {{ NETWORK_PUBLIC_DNS_RESOLVERS[0] }}`.
- group_vars/all/08_networks.yml: drop literal IP examples from the
resolver-block doc comment.
- compose/coredns/Corefile.tmpl, scripts/system/network/dns/setup/wsl.sh,
roles/sys-ctl-mtn-cert-deploy/SETUP.md: tag the legitimate literal
occurrences with `# noqa: hardcoded-dns-resolver`. These are
substitution points that cannot consume the variable (CoreDNS
forward directive, host-bootstrap shell fallback, Markdown example).
- docs/contributing/actions/testing/suppression.md: catalog the new
`hardcoded-dns-resolver` rule with position semantics and example.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
28 lines
446 B
Cheetah
28 lines
446 B
Cheetah
.:53 {
|
|
template IN A {
|
|
match ^${DOMAIN_RE}\.$
|
|
answer "{{ .Name }} 60 IN A ${IP4}"
|
|
fallthrough
|
|
}
|
|
|
|
template IN A {
|
|
match ^(.*)\.${DOMAIN_RE}\.$
|
|
answer "{{ .Name }} 60 IN A ${IP4}"
|
|
fallthrough
|
|
}
|
|
|
|
template IN AAAA {
|
|
match ^${DOMAIN_RE}\.$
|
|
fallthrough
|
|
}
|
|
|
|
template IN AAAA {
|
|
match ^(.*)\.${DOMAIN_RE}\.$
|
|
fallthrough
|
|
}
|
|
|
|
forward . 1.1.1.1 8.8.8.8 # noqa: hardcoded-dns-resolver
|
|
log
|
|
errors
|
|
}
|