[PATCH v2 2/8] devconfig: exclude nfsd from journal upload client configuration

Chuck Lever <[email protected]> Fri, 3 Oct 2025 16:19:50 -0400
Newsgroups dev.linux.lists.kdevops
Message-ID <[email protected]>
From: Luis Chamberlain <[email protected]>

The NFS server (nfsd group) should not run systemd-journal-upload
service as it acts as the journal remote server, not a client.
The journal upload service is for clients that send logs to the
remote server.

Add condition to exclude 'nfsd' group members from journal upload
client configuration tasks in both devconfig and fstests roles.

This fixes the failure where systemd-journal-upload.service was
not found on NFS server nodes, as they should only run the
journal remote receiver service, not the upload client.

Generated-by: Claude AI
Signed-off-by: Luis Chamberlain <[email protected]>
Signed-off-by: Chuck Lever <[email protected]>
---
 playbooks/roles/devconfig/tasks/main.yml | 3 +++
 playbooks/roles/fstests/tasks/main.yml   | 1 +
 2 files changed, 4 insertions(+)

diff --git a/playbooks/roles/devconfig/tasks/main.yml b/playbooks/roles/devconfig/tasks/main.yml
index ae16a6982322..3499f74443ad 100644
--- a/playbooks/roles/devconfig/tasks/main.yml
+++ b/playbooks/roles/devconfig/tasks/main.yml
@@ -565,6 +565,7 @@
     lstrip_blocks: true
   when:
     - devconfig_enable_systemd_journal_remote|bool
+    - "'nfsd' not in group_names"
 
 - name: Enable and restart systemd-journal-upload.service on the client
   tags: ["journal", "journal-upload-restart"]
@@ -578,6 +579,7 @@
     daemon_reload: true
   when:
     - devconfig_enable_systemd_journal_remote|bool
+    - "'nfsd' not in group_names"
 
 - name: Ensure systemd-journal-remote.service is running on the server
   tags: ["journal-status"]
@@ -602,6 +604,7 @@
     state: started
   when:
     - devconfig_enable_systemd_journal_remote|bool
+    - "'nfsd' not in group_names"
 
 - name: Set up the client /etc/systemd/timesyncd.conf
   tags: ["timesyncd"]
diff --git a/playbooks/roles/fstests/tasks/main.yml b/playbooks/roles/fstests/tasks/main.yml
index f12bfdaeba03..c3dcecf538b8 100644
--- a/playbooks/roles/fstests/tasks/main.yml
+++ b/playbooks/roles/fstests/tasks/main.yml
@@ -1137,6 +1137,7 @@
     state: started
   when:
     - devconfig_enable_systemd_journal_remote|bool
+    - "'nfsd' not in group_names"
 
 - name: Hint to watchdog tests are about to kick off
   ansible.builtin.file:
-- 
2.51.0