From 60677a37ad8fda4cd05c8b4eb5f318a63dff3e19 Mon Sep 17 00:00:00 2001 From: Emil Renner Berthing Date: Fri, 29 Jan 2021 17:13:04 +0100 Subject: space_server: chrony: start chrony after we're online --- roles/space_server/files/wait-online.conf | 1 + roles/space_server/tasks/chrony.yml | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/roles/space_server/files/wait-online.conf b/roles/space_server/files/wait-online.conf index 758b827..0a38143 100644 --- a/roles/space_server/files/wait-online.conf +++ b/roles/space_server/files/wait-online.conf @@ -1,2 +1,3 @@ [Unit] +Wants=network-online.target After=network-online.target diff --git a/roles/space_server/tasks/chrony.yml b/roles/space_server/tasks/chrony.yml index 2777591..633e2f2 100644 --- a/roles/space_server/tasks/chrony.yml +++ b/roles/space_server/tasks/chrony.yml @@ -8,6 +8,22 @@ mode: 0644 notify: restart chronyd +- name: Create service drop-in directory + file: + dest: '/etc/systemd/system/chronyd.service.d' + state: directory + owner: root + group: root + mode: 0755 + +- name: Start chrony after networks are configured + copy: + dest: '/etc/systemd/system/chronyd.service.d/wait-online.conf' + src: wait-online.conf + owner: root + group: root + mode: 0644 + - name: Enable chronyd service systemd: name: chronyd.service -- cgit v1.2.1