HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
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) <[email protected]>
    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