when: inventory_hostname != ansible_hostname
#+END_SRC
-** Configure Systemd Resolved
-
-Campus machines use the campus name server on Core (or ~dns.google~),
-and include the institute's private domain in their search lists.
-
-#+CAPTION: [[file:roles_t/campus/tasks/main.yml][=roles_t/campus/tasks/main.yml=]]
-#+BEGIN_SRC conf :tangle roles_t/campus/tasks/main.yml
-
-- name: Configure resolved.
- become: yes
- lineinfile:
- path: /etc/systemd/resolved.conf
- regexp: "{{ item.regexp }}"
- line: "{{ item.line }}"
- loop:
- - { regexp: '^ *DNS *=', line: "DNS={{ core_addr }}" }
- - { regexp: '^ *FallbackDNS *=', line: "FallbackDNS=8.8.8.8" }
- - { regexp: '^ *Domains *=', line: "Domains={{ domain_priv }}" }
- notify:
- - Reload Systemd.
- - Restart Systemd resolved.
-#+END_SRC
-
-#+CAPTION: [[file:roles_t/campus/handlers/main.yml][=roles_t/campus/handlers/main.yml=]]
-#+BEGIN_SRC conf :tangle roles_t/campus/handlers/main.yml :mkdirp yes
----
-- name: Reload Systemd.
- become: yes
- systemd:
- daemon-reload: yes
-
-- name: Restart Systemd resolved.
- become: yes
- systemd:
- service: systemd-resolved
- state: restarted
-#+END_SRC
-
** Configure Systemd Timesyncd
The institute uses a common time reference throughout the campus.
#+CAPTION: [[file:roles_t/campus/handlers/main.yml][=roles_t/campus/handlers/main.yml=]]
#+BEGIN_SRC conf :tangle roles_t/campus/handlers/main.yml
-
+---
- name: Restart systemd-timesyncd.
become: yes
systemd:
command: hostname -F /etc/hostname
when: inventory_hostname != ansible_hostname
-- name: Configure resolved.
- become: yes
- lineinfile:
- path: /etc/systemd/resolved.conf
- regexp: "{{ item.regexp }}"
- line: "{{ item.line }}"
- loop:
- - { regexp: '^ *DNS *=', line: "DNS={{ core_addr }}" }
- - { regexp: '^ *FallbackDNS *=', line: "FallbackDNS=8.8.8.8" }
- - { regexp: '^ *Domains *=', line: "Domains={{ domain_priv }}" }
- notify:
- - Reload Systemd.
- - Restart Systemd resolved.
-
- name: Configure timesyncd.
become: yes
lineinfile: