[PATCH 05/13] nfsd/fstests: fix pNFS block layout iSCSI configuration

Luis Chamberlain <[email protected]>
Newsgroups dev.linux.lists.kdevops
Message-ID <[email protected]>
For pNFS block layout testing, the NFS server must run the iSCSI
target service. Fix the Ansible role execution by:

1. Remove invalid delegate_to from include_role in fstests role
2. Add iSCSI target setup to nfsd role when pNFS is enabled
3. Keep iSCSI initiator setup with correct target hostname

The iSCSI target now runs on the NFS server itself, and test
nodes connect to it as initiators for pNFS block layout access.

Generated-by: Claude AI
Signed-off-by: Luis Chamberlain <[email protected]>
---
 playbooks/roles/fstests/tasks/main.yml | 8 --------
 playbooks/roles/nfsd/tasks/main.yml    | 6 ++++++
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/playbooks/roles/fstests/tasks/main.yml b/playbooks/roles/fstests/tasks/main.yml
index 357e33c4..831f5324 100644
--- a/playbooks/roles/fstests/tasks/main.yml
+++ b/playbooks/roles/fstests/tasks/main.yml
@@ -27,14 +27,6 @@
   tags: ["oscheck", "git", "fstests"]
   when: "fstests_xfs_build_custom_xfsprogs|bool"
 
-- name: Set up iSCSI target on NFS server for pNFS block layout
-  ansible.builtin.include_role:
-    name: iscsi
-  delegate_to: "{{ fstests_nfs_server_host }}"
-  when:
-    - fstests_nfs_section_pnfs|bool
-    - fstests_nfs_use_kdevops_nfsd|bool
-
 - name: Set up an iSCSI initiator on target nodes
   ansible.builtin.include_role:
     name: iscsi
diff --git a/playbooks/roles/nfsd/tasks/main.yml b/playbooks/roles/nfsd/tasks/main.yml
index cdd53ac9..3a32386d 100644
--- a/playbooks/roles/nfsd/tasks/main.yml
+++ b/playbooks/roles/nfsd/tasks/main.yml
@@ -22,6 +22,12 @@
     group: root
     mode: "0644"
 
+- name: Set up iSCSI target on NFS server for pNFS block layout
+  ansible.builtin.include_role:
+    name: iscsi
+  when:
+    - fstests_nfs_section_pnfs|default(false)|bool
+
 - name: Set up an iSCSI initiator
   ansible.builtin.include_role:
     name: iscsi
-- 
2.51.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.