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� � �v � d dl mZmZmZ eZdZdZdZd dl m Z d dlmZ d dl mZ d dlmZ G d � d e� � ZdS )� )�absolute_import�division�print_functiona� name: env author: Jan-Piet Mens (@jpmens) <jpmens(at)gmail.com> version_added: "0.9" short_description: Read the value of environment variables description: - Allows you to query the environment variables available on the controller when you invoked Ansible. options: _terms: description: - Environment variable or list of them to lookup the values for. required: True default: description: What return when the variable is undefined type: raw default: '' version_added: '2.13' notes: - You can pass the C(Undefined) object as C(default) to force an undefined error a� - name: Basic usage ansible.builtin.debug: msg: "'{{ lookup('ansible.builtin.env', 'HOME') }}' is the HOME environment variable." - name: Before 2.13, how to set default value if the variable is not defined. This cannot distinguish between USR undefined and USR=''. ansible.builtin.debug: msg: "{{ lookup('ansible.builtin.env', 'USR')|default('nobody', True) }} is the user." - name: Example how to set default value if the variable is not defined, ignores USR='' ansible.builtin.debug: msg: "{{ lookup('ansible.builtin.env', 'USR', default='nobody') }} is the user." - name: Set default value to Undefined, if the variable is not defined ansible.builtin.debug: msg: "{{ lookup('ansible.builtin.env', 'USR', default=Undefined) }} is the user." - name: Set default value to undef(), if the variable is not defined ansible.builtin.debug: msg: "{{ lookup('ansible.builtin.env', 'USR', default=undef()) }} is the user." zY _list: description: - Values from the environment variables. type: list )� Undefined)�AnsibleUndefinedVariable)� LookupBase)� py3compatc � � e Zd Zd� ZdS )�LookupModulec �X � | � ||�� � g }| � d� � }|D ]x}|� � � d }t j � ||� � }t |t � � rt d|z � � �|� |� � �y|S )N)�var_options�direct�defaultr z1The "env" lookup, found an undefined variable: %s) �set_options� get_option�splitr �environ�get� isinstancer r �append) �self�terms� variables�kwargs�ret�d�term�var�vals �?/usr/lib/python3.11/site-packages/ansible/plugins/lookup/env.py�runzLookupModule.runC s� � ����Y�v��>�>�>����O�O�I�&�&��� � �D��*�*�,�,�q�/�C��#�'�'��Q�/�/�C��#�y�)�)� j�.�/b�eh�/h�i�i�i��J�J�s�O�O�O�O�� � N)�__name__� __module__�__qualname__r! � r"