%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3.9/site-packages/ansible/plugins/lookup/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3.9/site-packages/ansible/plugins/lookup/__pycache__/lines.cpython-39.pyc

a

�)g��@sdddlmZmZmZeZdZdZdZddl	Z	ddl
mZddlm
Z
ddlmZGd	d
�d
e
�ZdS)�)�absolute_import�division�print_functiona�
    name: lines
    author: Daniel Hokka Zakrisson (!UNKNOWN) <daniel@hozac.com>
    version_added: "0.9"
    short_description: read lines from command
    description:
      - Run one or more commands and split the output into lines, returning them as a list
    options:
      _terms:
        description: command(s) to run
        required: True
    notes:
      - Like all lookups, this runs on the Ansible controller and is unaffected by other keywords such as 'become'.
        If you need to use different permissions, you must change the command or run Ansible as another user.
      - Alternatively, you can use a shell/command task that runs against localhost and registers the result.
a�
- name: We could read the file directly, but this shows output from command
  ansible.builtin.debug: msg="{{ item }} is an output line from running cat on /etc/motd"
  with_lines: cat /etc/motd

- name: More useful example of looping over a command result
  ansible.builtin.shell: "/usr/bin/frobnicate {{ item }}"
  with_lines:
    - "/usr/bin/frobnications_per_host --param {{ inventory_hostname }}"
za
  _list:
    description:
      - lines of stdout from command
    type: list
    elements: str
N)�AnsibleError)�
LookupBase��to_textc@seZdZdd�ZdS)�LookupModulec	Ksrg}|D]d}tj||j��dtjtjd�}|��\}}|jdkrZ|�dd�|��D��qt	d||jf��q|S)NT)�cwd�shell�stdin�stdoutrcSsg|]}t|��qS�r)�.0�lrr�@/usr/lib/python3.9/site-packages/ansible/plugins/lookup/lines.py�
<listcomp>;�z$LookupModule.run.<locals>.<listcomp>z#lookup_plugin.lines(%s) returned %d)
�
subprocess�PopenZ_loaderZget_basedir�PIPEZcommunicate�
returncode�extend�
splitlinesr)	�selfZtermsZ	variables�kwargs�retZterm�pr
�stderrrrr�run4s
zLookupModule.runN)�__name__�
__module__�__qualname__rrrrrr	2sr	)Z
__future__rrr�typeZ
__metaclass__Z
DOCUMENTATIONZEXAMPLESZRETURNrZansible.errorsrZansible.plugins.lookuprZansible.module_utils._textrr	rrrr�<module>s

Zerion Mini Shell 1.0