ansible / ansible.builtin / v2.15.10 / lookup / pipe read output from a command | "added in version" 0.9 of ansible.builtin" Authors: Daniel Hokka Zakrisson (!UNKNOWN) <daniel@hozac.com>ansible.builtin.pipe (v2.15.10) — lookup
pip
Install with pip install ansible-core==2.15.10
Run a command and return the output.
- name: raw result of running date command ansible.builtin.debug: msg: "{{ lookup('ansible.builtin.pipe', 'date') }}"
- name: Always use quote filter to make sure your variables are safe to use with shell ansible.builtin.debug: msg: "{{ lookup('ansible.builtin.pipe', 'getent passwd ' + myuser | quote ) }}"
_terms: description: command(s) to run. required: true
_string: description: - stdout from command elements: str type: list