diff --git a/src/ipaperftest/core/constants.py b/src/ipaperftest/core/constants.py index 522cfb3..85bcfaf 100644 --- a/src/ipaperftest/core/constants.py +++ b/src/ipaperftest/core/constants.py @@ -242,9 +242,19 @@ def getLevelName(level): - lineinfile: path: /etc/hosts line: '{server_ip} server.{domain} server' - - lineinfile: - path: /etc/resolv.conf - line: nameserver {server_ip} + - file: + path: /etc/systemd/resolved.conf.d + state: directory + - copy: + dest: /etc/systemd/resolved.conf.d/dns.conf + content: | + [Resolve] + DNS={server_ip} + Domains=~. + - systemd: + name: systemd-resolved + state: restarted + daemon-reload: yes - lineinfile: path: /etc/hosts regexp: '127.*.*.*\\s*replica*' @@ -271,6 +281,19 @@ def getLevelName(level): hosts: ipaclients become: yes tasks: + - file: + path: /etc/systemd/resolved.conf.d + state: directory + - copy: + dest: /etc/systemd/resolved.conf.d/dns.conf + content: | + [Resolve] + DNS={server_ip} + Domains=~. + - systemd: + name: systemd-resolved + state: restarted + daemon-reload: yes - lineinfile: path: /etc/resolv.conf regexp: ".*" @@ -307,6 +330,19 @@ def getLevelName(level): hosts: ipaclients become: yes tasks: + - file: + path: /etc/systemd/resolved.conf.d + state: directory + - copy: + dest: /etc/systemd/resolved.conf.d/dns.conf + content: | + [Resolve] + DNS={server_ip} + Domains=~. + - systemd: + name: systemd-resolved + state: restarted + daemon-reload: yes - lineinfile: path: /etc/resolv.conf regexp: ".*" @@ -406,6 +442,13 @@ def getLevelName(level): name: systemd-resolved state: restarted daemon-reload: yes + - lineinfile: + path: /etc/resolv.conf + regexp: ".*" + state: absent + - lineinfile: + path: /etc/resolv.conf + line: nameserver {server_ip} - lineinfile: path: /etc/hosts line: {server_ip} server.{domain} server