diff --git a/journal_upload/handlers/main.yml b/journal_upload/handlers/main.yml index bd06f75..ea6d0b5 100644 --- a/journal_upload/handlers/main.yml +++ b/journal_upload/handlers/main.yml @@ -1,4 +1,8 @@ --- +- name: Reload systemd manager + ansible.builtin.systemd: + daemon_reload: true + - name: Restart systemd-journal-upload ansible.builtin.systemd: name: systemd-journal-upload diff --git a/journal_upload/tasks/main.yml b/journal_upload/tasks/main.yml index 89604c5..f8efbaf 100644 --- a/journal_upload/tasks/main.yml +++ b/journal_upload/tasks/main.yml @@ -49,6 +49,31 @@ notify: Restart systemd-journal-upload no_log: true +# The default start limit (5 starts within 10 seconds) gives up during an ingest outage. The +# uploader resumes from its cursor, so it keeps retrying. +- name: Create the uploader unit drop-in directory + ansible.builtin.file: + path: /etc/systemd/system/systemd-journal-upload.service.d + state: directory + mode: "0755" + +- name: Keep the uploader retrying through ingest outages + ansible.builtin.copy: + dest: /etc/systemd/system/systemd-journal-upload.service.d/restart.conf + mode: "0644" + content: | + [Unit] + StartLimitIntervalSec=0 + + [Service] + Restart=always + RestartSec=30s + notify: Reload systemd manager + +# The reload has to precede the start below, which otherwise hits the default start limit. +- name: Load the uploader drop-in + ansible.builtin.meta: flush_handlers + - name: Enable the journal uploader ansible.builtin.systemd: name: systemd-journal-upload