diff --git a/CHANGELOG.md b/CHANGELOG.md index ce43a991..46dbab0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,9 @@ -## v2.3.3 (UNRELEASED) +## v2.3.3 - Add services management (thanks @Sispheor) - Add enable_local_script_checks configuration (thanks @canardleteer) - Add ability to enable legacy GUI (thanks @imcitius) +- Optional domain datacenter delegation with `consul_delegate_datacenter_dns` ## v2.3.2 diff --git a/README.md b/README.md index c1c3ea61..6e07c6bf 100644 --- a/README.md +++ b/README.md @@ -929,6 +929,11 @@ consul3.node.consul. 0 IN A 10.1.42.230 ;; WHEN: Sun Aug 7 18:06:32 2016 ;; ``` + +### `consul_delegate_datacenter_dns` +- Whether to delegate Consul datacenter DNS domain to Consul +- Default value: false + ### `consul_dnsmasq_enable` - Whether to install and configure DNS API forwarding on port 53 using DNSMasq diff --git a/defaults/main.yml b/defaults/main.yml index 57e57a52..24234bed 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -191,6 +191,7 @@ consul_tls_verify_server_hostname: false consul_tls_files_remote_src: false ## DNS +consul_delegate_datacenter_dns: "{{ lookup('env','CONSUL_DELEGATE_DATACENTER_DNS') | default(false, true) }}" consul_dnsmasq_enable: "{{ lookup('env','CONSUL_DNSMASQ_ENABLE') | default(false, true) }}" consul_dnsmasq_bind_interfaces: false consul_dnsmasq_consul_address: "\ @@ -211,6 +212,7 @@ consul_dnsmasq_local_service: false consul_dnsmasq_listen_addresses: [] consul_iptables_enable: "{{ lookup('env','CONSUL_IPTABLES_ENABLE') | default(false, true) }}" +# Consul Enterprise consul_enterprise: "{{ lookup('env','CONSUL_ENTERPRISE') | default(false, true) }}" # Performance diff --git a/templates/dnsmasq-10-consul.j2 b/templates/dnsmasq-10-consul.j2 index a4c25218..4f4785b6 100644 --- a/templates/dnsmasq-10-consul.j2 +++ b/templates/dnsmasq-10-consul.j2 @@ -1,5 +1,9 @@ -{# Enable forward lookups for the consul domain -#} +{# Enable forward lookups for the consul domain with conditional delegation -#} +{% if consul_delegate_datacenter_dns -%} server=/{{ consul_datacenter }}.{{ consul_domain }}/{{ consul_dnsmasq_consul_address }}#{{ consul_ports.dns }} +{% else %} +server=/{{ consul_domain }}/{{ consul_dnsmasq_consul_address }}#{{ consul_ports.dns }} +{% endif -%} {# Only bind to specific interfaces -#} {% if consul_dnsmasq_bind_interfaces -%}