ntih.random.pipe (0.0.1) — module

Pipe local command to a remote command

| "added in version" 1.0.0 of ntih.random"

Authors: LoveIsGrief (@LoveIsGrief)

This plugin has a corresponding action plugin.

Install collection

Install with ansible-galaxy collection install ntih.random:==0.0.1


Add to requirements.yml

  collections:
    - name: ntih.random
      version: 0.0.1

Description

The C(pipe) action executes a command locally and pipes the output thereof to a remote host.

The same can also be achieved with text output using :: - shell: remote_command input: "{{ lookup('pipe', 'local_command') }}"

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Copy file with owner and permissions
  ansible.builtin.pipe:
    local: docker save {{ image }}
    remote: docker load

Inputs

    
local:
    description:
    - The command to execute on the local machine
    required: true
    type: str

remote:
    description:
    - The command to execute on the remote machine.
    - Its input will be the stdoutput of the local command
    required: true
    type: str

Outputs

local.rc:
  description: Return code of the local command
  returned: always
  sample: 0
  type: int
remote.rc:
  description: Return code of the remote command
  returned: always
  sample: 0
  type: int

See also