# Wait for ISCSI File System

**URL:** <https://forum.ansible.com/t/wait-for-iscsi-file-system/2987>\
**Category:** Get Help\
**Tags:** rhel, playbook, ansible-core\
**Created:** [December 19, 2023, 9:17pm UTC](https://forum.ansible.com/t/wait-for-iscsi-file-system/2987 "2023-12-19T21:17:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nlwmn](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/nlwmn/32/1524_2.png) [@nlwmn](https://forum.ansible.com/u/nlwmn)\
**Post date:** [December 19, 2023, 9:17pm UTC](https://forum.ansible.com/t/wait-for-iscsi-file-system/2987/1 "2023-12-19T21:17:24Z")

</div>

Hello,

I am running some plays on a RHEL-HA cluster. The ISCSI shared storage is mounted with pacemaker. For the plays I am using pacemaker to move the file system between nodes. Is there a good way to enure the ISCSI filesystem is mounted before continuing? The `ansible.posix.mount` is not being used becuase pacemaker needs to control the mounting.

The current path I am headed down is write a text file on the shared storage then use the `ansible.builtin.wait_for` module to wait until a string is found in the text file. Seems like a potential short term solution. There must be something better though.

Another potential path is using the command `mountpoint /iscsi`. In the output below the command is run against all three nodes in the cluster. It seems like there should be a way for the `ansible.builtin.wait_for` module to wait for a zero return code, but I don’t see it.

```auto
ansible beta_cluster -b -a 'mountpoint /iscsi'

node3 | FAILED | rc=1 >>
/iscsi is not a mountpointnon-zero return code

node1 | FAILED | rc=1 >>
/iscsi is not a mountpointnon-zero return code

node2 | CHANGED | rc=0 >>
/iscsi is a mountpoint

```

Thank you

---

<div class="post-metadata">

**Author:** ![nlwmn](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/nlwmn/32/1524_2.png) [@nlwmn](https://forum.ansible.com/u/nlwmn)\
**Post date:** [December 19, 2023, 10:39pm UTC](https://forum.ansible.com/t/wait-for-iscsi-file-system/2987/2 "2023-12-19T22:39:31Z")

</div>

The path of waiting for a file on the shared storage did work.

```auto
   - name: Check if /iscsi is mounted
      ansible.builtin.wait_for:
        path: /iscsi/testmount.txt
        state: present
        timeout: 20

```

Seems like there is a better way though.
