Check if file exists on any remote

Hi!

I wonder if it is possible to check if for example a file exists on any in a group.

My use case:

I want to create an MD raid over 2 LUNs for a ServiceGuard cluster. This must only happen on one of the cluster nodes and should not be done multiple times (if the raid is active on a different node it should not be run again).
To achieve this I would like to test if /dev/md1 exists on any of the nodes.

Does anyone of you have an idea how to solve this?

I already taught about using stat and register variables but the problem here is that such a variable is only available for one node. Is there a way to access a variable of other nodes during a play or make it available for other nodes?

Thanks in advance for any help.

Best,
Martin

Are you sure you need to access variables from the other nodes, since you did not explain in more detail about what you are trying to do it's hard to tell.

Anyway to access the variables on an other host you can use hostvars. On host1 you can do {{ hostvars.host2.myvar }} to get access to myvar on host2.