Set DynamicUser in systemd-journal-upload unit file

At least on Ubuntu 18.04, the `systemd-journal-remote` doesn't create
the `systemd-journal-upload` user, since the service is supposed to run
with `DynamicUser=True`.

This commit ensures that `DynamicUser` and `StateDirectory` are set
appropriately on all Systemd versions that support them (i.e. >= 235).

It requires https://review.openstack.org/#/c/630664/ to be merged first.

Change-Id: I743e936df9e69ef5532b7ec69e29057d4f1f8ef2
Closes-Bug: 1805847
This commit is contained in:
Benoît Knecht 2019-01-14 14:17:40 +01:00 committed by Dmitriy Rabotyagov
parent bc3c90187b
commit 8c057ad76f

View File

@ -122,6 +122,8 @@
--save-state
--merge
--url=http://{{ systemd_journal_remote_target }}:19532
dynamic_user: true
state_directory: systemd/journal-upload
vars:
systemd_journal_remote_target: "{{ hostvars[groups['log_hosts'][0]]['ansible_host'] }}"