Skip to content

Commit

Permalink
TMP #2
Browse files Browse the repository at this point in the history
  • Loading branch information
eifelmicha committed Oct 12, 2024
1 parent 9c3a4be commit 45c72f1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
23 changes: 10 additions & 13 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,20 +109,17 @@
- name: Systemd-resolved forwarding
when: _consul.use_dns_forwarding | default(false)
block:
- name: Create /etc/systemd/resolved.conf.d/
ansible.builtin.file:
path: /etc/systemd/resolved.conf.d/
state: directory
owner: root
group: root

- name: Create systemd-resolved config to forward consul domain to agent
ansible.builtin.template:
src: "{{ item }}.j2"
dest: /{{ item }}
mode: "0644"
- name: Configure systemd-resolved
community.general.ini_file:
path: /etc/systemd/resolved.conf.d/consul.conf
section: "Resolve"
option: "{{ item.key }}"
value: "{{ item.value }}"
state: present
mode: '0644'
loop:
- etc/systemd/resolved.conf.d/consul.conf
- { key: DNS, value: "127.0.0.1:{{ _consul.dns_port | default(8600) }}" }
- { key: Domains, value: "~{{ _consul.domain }}" }
register: systemd_resolved_consul

- name: Restart systemd-resolved
Expand Down
4 changes: 0 additions & 4 deletions templates/etc/systemd/resolved.conf.d/consul.conf.j2

This file was deleted.

0 comments on commit 45c72f1

Please sign in to comment.