pytoccaz / pytoccaz.utils / 1.1.0 / module / get_binary_path Find system executable | "added in version" 1.0.0 of pytoccaz.utils" Authors: Olivier Bernard (@pytoccaz)pytoccaz.utils.get_binary_path (1.1.0) — module
Install with ansible-galaxy collection install pytoccaz.utils:==1.1.0
collections: - name: pytoccaz.utils version: 1.1.0
Find system executable in PATH.
- name: Search python3 in PATH pytoccaz.utils.get_binary_path: name: python3 register: python_binary
- debug: var: python_binary.path
name: aliases: - binary description: - Name of the binary required: true type: str version_added: 1.0.0 version_added_collection: pytoccaz.utils option_dirs: aliases: - opt_dirs description: - Optional list of directories to search in addition to PATH elements: str required: false type: list version_added: 1.0.0 version_added_collection: pytoccaz.utils
exists: description: If the destination path actually exists and the user can access it returned: always sample: true type: bool gid: description: Numeric id representing the group of the owner returned: when exists is true sample: 0 type: int group: description: Group name of owner returned: when exists is true sample: root type: str mode: description: Unix permissions of the file in octal representation as a string returned: when exists is true sample: '0777' type: str owner: description: Name of owner returned: when exists is true sample: root type: str path: description: Path of the searched binary if it exists in PATH and the user can access it, else null returned: always sample: /usr/bin/python3 type: str size: description: Size in bytes for a plain file, amount of data for some special files returned: when exists is true sample: 9 type: int state: description: Nature of the file returned: when exists is true sample: link type: str uid: description: Numeric id representing the file owner returned: when exists is true sample: 0 type: int