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