add systemd-resolved consul forwarding
add systemd-resolved consul redirection
This commit is contained in:
parent
bd58af864c
commit
875cdad424
@ -32,3 +32,4 @@ consul_backup_location: ""
|
|||||||
consul_cron_hour: 1
|
consul_cron_hour: 1
|
||||||
consul_retry_join_force:
|
consul_retry_join_force:
|
||||||
consul_dnsmasq_enable: False
|
consul_dnsmasq_enable: False
|
||||||
|
consul_systemd_resolved_enable: False
|
||||||
|
@ -9,3 +9,8 @@
|
|||||||
name: dnsmasq
|
name: dnsmasq
|
||||||
enabled: true
|
enabled: true
|
||||||
state: restarted
|
state: restarted
|
||||||
|
- name: restart systemd-resolved
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: systemd-resolved
|
||||||
|
enabled: true
|
||||||
|
state: restarted
|
||||||
|
@ -178,3 +178,7 @@
|
|||||||
|
|
||||||
- include_tasks: dnsmasq.yml
|
- include_tasks: dnsmasq.yml
|
||||||
when: consul_dnsmasq_enable | bool
|
when: consul_dnsmasq_enable | bool
|
||||||
|
|
||||||
|
- name: include systemd-resolved
|
||||||
|
ansible.builtin.include_tasks: systemd-resolved.yml
|
||||||
|
when: consul_systemd_resolved_enable
|
||||||
|
17
tasks/systemd-resolved.yml
Normal file
17
tasks/systemd-resolved.yml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Ensure resolved.conf.d is present
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /etc/systemd/resolved.conf.d
|
||||||
|
state: directory
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "755"
|
||||||
|
- name: "Template resolved consul config"
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: resolved.conf.d/consul.conf.j2
|
||||||
|
dest: /etc/systemd/resolved.conf.d/consul.conf
|
||||||
|
group: root
|
||||||
|
owner: root
|
||||||
|
mode: "644"
|
||||||
|
notify: restart systemd-resolved
|
4
templates/resolved.conf.d/consul.conf.j2
Normal file
4
templates/resolved.conf.d/consul.conf.j2
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[Resolve]
|
||||||
|
DNS=127.0.0.1:8600
|
||||||
|
DNSSEC=false
|
||||||
|
Domains=~consul
|
Loading…
Reference in New Issue
Block a user