%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__/env.cpython-39.opt-1.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

Zerion Mini Shell 1.0