Skip to content

Commit 341a042

Browse files
committed
Fix local NFS validation mount and task guards
Use ansible_host instead of localhost for the local NFS mount test so the client IP matches the export ACL (10.10.10.0/24). Also fix read and cleanup task guards to check test_mount.rc instead of test_write, since Ansible considers skipped tasks as succeeded.
1 parent b5596b1 commit 341a042

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

metal/roles/storage/tasks/nfs_validation.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
mode: "0755"
9494

9595
- name: Test mount NFS export locally # noqa command-instead-of-module
96-
command: "mount -t nfs localhost:/mnt/storage/Temp /tmp/nfs_test_mount"
96+
command: "mount -t nfs {{ ansible_host }}:/mnt/storage/Temp /tmp/nfs_test_mount"
9797
register: test_mount
9898
changed_when: false
9999
failed_when: false
@@ -108,15 +108,15 @@
108108

109109
- name: Test read from NFS mount
110110
command: cat /tmp/nfs_test_mount/.nfs_test_file
111-
when: test_write is succeeded
111+
when: test_mount.rc == 0
112112
register: test_read
113113
changed_when: false
114114

115115
- name: Cleanup test file
116116
file:
117117
path: /tmp/nfs_test_mount/.nfs_test_file
118118
state: absent
119-
when: test_write is succeeded
119+
when: test_mount.rc == 0
120120

121121
- name: Unmount test NFS share
122122
command: umount /tmp/nfs_test_mount

0 commit comments

Comments
 (0)