Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3.11/site-packages/ansible/plugins/lookup/__pycache__/ |
Upload File : |
� ���c� � �r � d dl mZmZmZ eZdZdZdZd dl Z d dl mZ d dlm Z d dlmZ G 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 � � e Zd Zd� ZdS )�LookupModulec �t � g }|D ]�}t j || j � � � dt j t j �� � }|� � � \ }}|j dk r2|� d� |� � � D � � � � ��t d||j fz � � �|S )NT)�cwd�shell�stdin�stdoutr c �, � g | ]}t |� � ��S � r )�.0�ls �A/usr/lib/python3.11/site-packages/ansible/plugins/lookup/lines.py� <listcomp>z$LookupModule.run.<locals>.<listcomp>; s � �D�D�D�1�G�A�J�J�D�D�D� z#lookup_plugin.lines(%s) returned %d) � subprocess�Popen�_loader�get_basedir�PIPE�communicate� returncode�extend� splitlinesr ) �self�terms� variables�kwargs�ret�term�pr �stderrs r �runzLookupModule.run4 s� � ���� a� a�D�� ��4�<�+C�+C�+E�+E�T�Yc�Yh�q{� rA� B� B� B�A� �}�}����V�V��|�q� � �� � �D�D��0A�0A�0C�0C�D�D�D�E�E�E�E�"�#H�D�RS�R^�K_�#_�`�`�`�� r N)�__name__� __module__�__qualname__r) r r r r r 2 s# � � � � � � � � � � r r )� __future__r r r �type� __metaclass__� DOCUMENTATION�EXAMPLES�RETURNr �ansible.errorsr �ansible.plugins.lookupr �ansible.module_utils._textr r r r r �<module>r6 s� �� C� B� B� B� B� B� B� B� B� B�� �� �" �� �� � � � � '� '� '� '� '� '� -� -� -� -� -� -� .� .� .� .� .� .�� � � � �:� � � � � r