[PATCH 09/13] nfsd_add_export: fix become method for filesystem formatting

Luis Chamberlain <[email protected]>
Newsgroups dev.linux.lists.kdevops
Message-ID <[email protected]>
The filesystem module was unable to find mkfs.xfs when using
'become_flags: "su - -c"' which changes the environment.
Change to use standard 'become_method: sudo' to preserve
the PATH and allow the module to find the mkfs.xfs executable.

Generated-by: Claude AI
Signed-off-by: Luis Chamberlain <[email protected]>
---
 playbooks/roles/nfsd_add_export/tasks/storage/local.yml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/playbooks/roles/nfsd_add_export/tasks/storage/local.yml b/playbooks/roles/nfsd_add_export/tasks/storage/local.yml
index c366a13f..aaaf1de1 100644
--- a/playbooks/roles/nfsd_add_export/tasks/storage/local.yml
+++ b/playbooks/roles/nfsd_add_export/tasks/storage/local.yml
@@ -11,8 +11,7 @@
 
 - name: Format new volume for {{ export_fstype }}
   become: true
-  become_flags: "su - -c"
-  become_method: ansible.builtin.sudo
+  become_method: sudo
   delegate_to: "{{ server_host }}"
   community.general.filesystem:
     fstype: "{{ export_fstype }}"
-- 
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.