%PDF- %PDF-
| Direktori : /lib/python3.9/site-packages/ansible/parsing/__pycache__/ |
| Current File : //lib/python3.9/site-packages/ansible/parsing/__pycache__/mod_args.cpython-39.pyc |
a
�)g�5 � @ s� d dl mZmZmZ eZd dlmZ d dl m
Z
mZmZ d dl
mZ d dlmZ d dlmZmZ d dlmZmZ d dlmZ d d lmZ d d
lmZ eej�Ze� ed��Z!eed��Z"G d
d� d�Z#dS )� )�absolute_import�division�print_functionN)�AnsibleParserError�AnsibleError�AnsibleAssertionError)�string_types)�to_text)�parse_kv�
split_args)�
module_loader�
action_loader)�Templar)�add_internal_fqcns)�Sentinel)
�includeZinclude_vars�
include_tasks�include_role�import_tasks�import_roleZadd_hostZgroup_byZset_fact�meta)r r r r r r c @ sF e Zd ZdZddd�Zdd� Zddd�Zd d
� Zdd� Zddd�Z dS )�ModuleArgsParsera?
There are several ways a module and argument set can be expressed:
# legacy form (for a shell command)
- action: shell echo hi
# common shorthand for local actions vs delegate_to
- local_action: shell echo hi
# most commonly:
- copy: src=a dest=b
# legacy form
- action: copy src=a dest=b
# complex args form, for passing structured data
- copy:
src: a
dest: b
# gross, but technically legal
- action:
module: copy
args:
src: a
dest: b
# Standard YAML form for command-type modules. In this case, the args specified
# will act as 'defaults' and will be overridden by any args specified
# in one of the other formats (complex args under the action, or
# parsed from the k=v string
- command: 'pwd'
args:
chdir: '/tmp'
This class has some of the logic to canonicalize these into the form
- module: <module_name>
delegate_to: <optional>
args: <args>
Args may also be munged for certain shell command parameters.
Nc C s� |d u ri n|}t |t�s*tdt|� ��|| _|| _ddlm} ddlm } t
|j�| _| j�
t
|j�� | j�
ddg� t| j�| _d | _d S )Nz3the type of 'task_ds' should be a dict, but is a %sr )�Task)�Handler�local_actionZstatic)�
isinstance�dictr �type�_task_ds�_collection_listZansible.playbook.taskr Zansible.playbook.handlerr �setZfattributes�_task_attrs�update� frozenset�resolved_action)�selfZtask_ds�collection_listr r � r'