ansible.builtin.pipe (v2.7.17) — lookup

read output from a command

| "added in version" 0.9 of ansible.builtin"

Authors: Daniel Hokka Zakrisson <daniel@hozac.com>

Install Ansible via pip

Install with pip install ansible==2.7.17

Description

Run a command and return the output

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: raw result of running date command"
  debug: msg="{{ lookup('pipe','date') }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Always use quote filter to make sure your variables are safe to use with shell
  debug: msg="{{ lookup('pipe','getent ' + myuser|quote ) }}"

Inputs

    
_terms:
    description: command(s) to run
    required: true

Outputs

_string:
  description:
  - stdout from command