Is there a canonical way in Ansible to check to see if a file system is
mounted? The Ansible mount module doesn't appear to provide this
capability (or at least the examples don't illustrate how it might be
done). Currently I'm doing the following but it doesn't work:
- name: check if mounted
command: mount | grep <file_system>
register: result
- debug: var={{ result.stdout }}
I get the error:
failed... 'Consider using mount module rather than running mount'...
stderr:
Usage:
mount [-lhV]
...
What I'm hoping to replicate is running that command. If you run it when
the file system is mounted and then do "echo $?" you'll get "0". However
if the file system isn't mounted, you'll get "1".
Thank you.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/cf85f24c-8575-4314-9d23-759ab44cdf96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.