From 5c73830cb46c8d25b928a9da51c409a2312eaada Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Tue, 27 Jun 2023 14:53:13 -0400 Subject: [PATCH] navidrome: also use systemd override --- roles/services/navidrome/tasks/main.yml | 23 ++++++++++++++----- .../navidrome/templates/navidrome.service.j2 | 6 +++++ 2 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 roles/services/navidrome/templates/navidrome.service.j2 diff --git a/roles/services/navidrome/tasks/main.yml b/roles/services/navidrome/tasks/main.yml index f0a1abc..1e60510 100644 --- a/roles/services/navidrome/tasks/main.yml +++ b/roles/services/navidrome/tasks/main.yml @@ -73,12 +73,23 @@ line: "Environment=HOME={{ dataroot }}/navidrome/" notify: Run daemon-reload for Navidrome -- name: Allow Navidrome to write in data directory - lineinfile: - dest: /usr/lib/systemd/system/navidrome.service - regexp: "^ReadWritePaths=.*" - line: "ReadWritePaths={{ dataroot }}/navidrome/" - notify: Run daemon-reload for Navidrome +- name: Create systemd override dir + file: + path: /etc/systemd/system/navidrome.service.d/ + state: directory + owner: root + group: root + mode: 0755 + +- name: Deploy systemd override conf + template: + src: navidrome.service.j2 + dest: /etc/systemd/system/navidrome.service.d/override.conf + owner: root + group: root + mode: 0644 + notify: + - Run daemon-reload for Navidrome - name: Configure Navidrome template: diff --git a/roles/services/navidrome/templates/navidrome.service.j2 b/roles/services/navidrome/templates/navidrome.service.j2 new file mode 100644 index 0000000..2a0a27c --- /dev/null +++ b/roles/services/navidrome/templates/navidrome.service.j2 @@ -0,0 +1,6 @@ +[Service] +ReadWritePaths={{ dataroot }}/navidrome/ +CPUWeight=20 +CPUQuota=85% +IOWeight=20 +MemorySwapMax=0