sap.sap_operations.mount_path filter – Return the mount path of the filepath.

Note

This filter plugin is part of the sap.sap_operations collection.

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install sap.sap_operations.

To use it in a playbook, specify: sap.sap_operations.mount_path.

New in sap.sap_operations 1.10.0

Synopsis

  • Filter plugin is intended to be used this way ansible_facts[‘mounts’] | sap.sap_operations.mount_path(filepath=’/file/path’)

  • From all mounts only one where file is located will be returned.

  • All other mounts will be filtered out.

Keyword parameters

This describes keyword parameters of the filter. These are the values key1=value1, key2=value2 and so on in the following example: input | sap.sap_operations.mount_path(key1=value1, key2=value2, ...)

Parameter

Comments

filepath

path / required

From all mounts only mount that contain this filepath will not be filtered out.

Notes

Note

  • This module is community supported

  • Module interface (parameters, output) expected to be stable but not guaranteed

  • Module planned to be released on Ansible Automation Hub after collecting some feedback

  • There is no guarantee that this module will be officially supported by Red Hat

Examples

- name: Example how to use mount_path filter
  debug:
    msg: "{{ ansible_facts['mounts'] | sap.sap_operations.mount_path(filepath='/') }}"

Return Value

Key

Description

data

string

Parameter `mount` from `ansible_mounts` list that was collected by `ansible.builtin.setup` module

This is mount point there file with provided `filepath` is located.

If provided filepath is not found filter returns None.

If list of mounts is empty filter returns None.

Returned: success

Authors

  • Ondra Machacek (@machacekondra)

  • Kirill Satarin (@kksat)

Hint

Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.