sap.sap_operations.mount_path (1.25.0) — filter

Return the mount path of the filepath.

| "added in version" 1.10.0 of sap.sap_operations"

Authors: Ondra Machacek (@machacekondra), Kirill Satarin (@kksat)

Install collection

Install with ansible-galaxy collection install sap.sap_operations:==1.25.0


Add to requirements.yml

  collections:
    - name: sap.sap_operations
      version: 1.25.0

Description

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.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Example how to use mount_path filter
  debug:
    msg: "{{ ansible_facts['mounts'] | sap.sap_operations.mount_path(filepath='/') }}"

Inputs

    
filepath:
    description: From all mounts only mount that contain this filepath will not be filtered
      out.
    required: true
    type: path

Outputs

data:
  description:
  - 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.
  type: str