Commit 5d02d523 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

Configure systemd-resolved when present

parent 3c4c9495
......@@ -7,3 +7,6 @@
- name: restart sshd
service: name=sshd state=restarted
when: ansible_os_family == "RedHat"
- name: restart systemd-resolved
service: name=systemd-resolved state=restarted
......@@ -53,18 +53,11 @@
script: format_hosts /tmp/hosts tl.teralab-datascience.fr
when: cluster_hash.stat.exists == True
- name: managing resolv.conf file
lineinfile: dest=/etc/resolv.conf line="search tl.teralab-datascience.fr"
- include: resolv_conf.yml
when: ansible_distribution != "Ubuntu" or ansible_distribution_major_version|int < 18
- name: adding entry from workspace
lineinfile: dest=/etc/resolv.conf line="nameserver 10.200.218.1"
- name: Delete default nameserver
lineinfile: dest=/etc/resolv.conf line="nameserver 10.0.2.3" state=absent
- name: Delete nameserver 8.8.8.8
lineinfile: dest=/etc/resolv.conf line="nameserver 8.8.8.8" state=absent
when: is_playbook_ok in [False, "False"]
- include: resolv_conf_systemd.yml
when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int >= 18
- name: Turn off dhclient if it's running
shell: pkill dhclient
......
- name: managing resolv.conf file
lineinfile: dest=/etc/resolv.conf line="search tl.teralab-datascience.fr"
- name: adding entry from workspace
lineinfile: dest=/etc/resolv.conf line="nameserver 10.200.218.1"
- name: Delete default nameserver
lineinfile: dest=/etc/resolv.conf line="nameserver 10.0.2.3" state=absent
- name: Delete nameserver 8.8.8.8
lineinfile: dest=/etc/resolv.conf line="nameserver 8.8.8.8" state=absent
when: is_playbook_ok in [False, "False"]
- name: configuring systemd-resolved (add search)
lineinfile: dest=/etc/systemd/resolved.conf line="Domains=tl.teralab-datascience.fr"
- name: configuring systemd-resolved (add DNS)
lineinfile: dest=/etc/systemd/resolved.conf line="DNS=10.200.218.1"
- name: configuring systemd-resolved (no FallbackDNS)
lineinfile: dest=/etc/systemd/resolved.conf line="FallbackDNS="
- name: restart systemd-resolved service
notify: restart systemd-resolved
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment