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__/env.cpython-39.pyc
a

�)g�
�@shddlmZmZmZeZdZdZdZddl	m
Z
ddlmZddl
mZddlmZGd	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@seZdZdd�ZdS)�LookupModulec	Ksd|j||d�g}|�d�}|D]>}|��d}tj�||�}t|t�rTtd|��|�	|�q |S)N)Zvar_optionsZdirect�defaultrz1The "env" lookup, found an undefined variable: %s)
Zset_optionsZ
get_option�splitr�environ�get�
isinstancerr�append)	�selfZtermsZ	variables�kwargs�ret�dZterm�var�val�r�>/usr/lib/python3.9/site-packages/ansible/plugins/lookup/env.py�runCs

zLookupModule.runN)�__name__�
__module__�__qualname__rrrrrr	Bsr	N)Z
__future__rrr�typeZ
__metaclass__Z
DOCUMENTATIONZEXAMPLESZRETURNZjinja2.runtimerZansible.errorsrZansible.plugins.lookuprZ
ansible.utilsrr	rrrr�<module>s