Skip to content

Commit 6017bb8

Browse files
committed
nfsd_add_export: fix become method for filesystem formatting
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]>
1 parent 0c58639 commit 6017bb8

File tree

1 file changed

+1
-2
lines changed
  • playbooks/roles/nfsd_add_export/tasks/storage

1 file changed

+1
-2
lines changed

playbooks/roles/nfsd_add_export/tasks/storage/local.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111

1212
- name: Format new volume for {{ export_fstype }}
1313
become: true
14-
become_flags: "su - -c"
15-
become_method: ansible.builtin.sudo
14+
become_method: sudo
1615
delegate_to: "{{ server_host }}"
1716
community.general.filesystem:
1817
fstype: "{{ export_fstype }}"

0 commit comments

Comments
 (0)