a )g5@sxddlmZmZmZeZddlZddlZddlm Z ddl m Z ddl mZddlmZddlmZGdd d eZdS) )absolute_importdivisionprint_functionN) constants)get_action_args_with_defaults)boolean) ActionBase) merge_hashcs.eZdZddZddZdfdd ZZS) ActionModulec Cs&|jj}|tjvrz|jjd}Wn$tyL|jj dd}Yn0|dvr| dd}|ddgfvr|j d||f| dd}|dur|j d ||f| d d}|dur|j d ||ftd d |D}|jjj||jjdj}t|||jj|j|jjjjd}|S)Nzansible.netcommon..)Z network_cliZhttpapiZnetconfZ gather_subsetallzIgnoring subset(%s) for %sZgather_timeoutzIgnoring timeout(%s) for %sfilterzIgnoring filter(%s) for %scss"|]\}}|dur||fVqdS)N).0kvrrG/usr/lib/python3.9/site-packages/ansible/plugins/action/gather_facts.py .z0ActionModule._get_module_args..)Zcollection_list)Z action_groups)_taskargscopyCZ _ACTION_SETUP _connection ansible_name removeprefixAttributeErrorZ _load_namesplitpop_displayZwarningdictitemsZ_shared_loader_objZ module_loaderZfind_plugin_with_context collectionsZ resolved_fqcnrZmodule_defaultsZ_templarZ_parentZ_play_action_groups) self fact_module task_varsmod_argsnameZsubsettimeoutZ fact_filterZresolved_fact_modulerrr_get_module_argss2       zActionModule._get_module_argscCs2|di|dg|dgd}t||ddS)N ansible_factswarnings deprecations)r,r-r.Z append_rp)Z list_merge)getr )r%resultZ task_resultZ filtered_resrrr_combine_task_result<s    z!ActionModule._combine_task_resultNc sd|_tt|||}i|d<ttjjd|d}|d|j j dd}d|vrtjjd|d}|j j d | d | di d }| | |p|j jd g||di}i} |durt|d krd}nt|}|r\|D]^} || |} |j| | |d d} | dd r$| || <q| dd r<| | | <q||| }q||j jjni} |D]8} || |} |jd| |j| | |dd| | <qd| rX| D]}| |dtj| |dd}|jd||d d} | ddd kr<| dd r | ||<n$| dd r"| | |<n ||| }| |=qn tdqtdq| rdd| |d<| |d<t| t|krd|d<|rd|d<dd| |d<||d<d|dd <d|d!<|S)"NTr,Z FACTS_MODULES)Z variablesZansible_facts_parallelparallelZsmartZCONNECTION_FACTS_MODULES network_osZansible_network_oszansible.legacy.setupF)Z module_nameZ module_argsr'Z wrap_asyncfailedskippedz Running %sZansible_job_idZ results_file)ZjidZ _async_dirzansible.legacy.async_statusfinishedrg?g?z'The following modules were skipped: %s z, msgZskipped_modulesz,The following modules failed to execute: %s Zfailed_modulesZ_ansible_facts_gatheredZ_ansible_verbose_override)!Z_supports_check_modesuperr runlistrZconfigZget_config_valuerrrr/extendrrindexlenrr+Z_execute_moduler1Z_remove_tmp_pathZ_shellZtmpdirr Zvvvvospathdirnametimesleepjoinkeys)r%tmpr'r0modulesr2Zconnection_mapr3r5r6r&r(resZjobsmoduleZ poll_args __class__rrr:Fsp&    "    zActionModule.run)NN)__name__ __module__ __qualname__r+r1r: __classcell__rrrJrr s) r )Z __future__rrrtypeZ __metaclass__r?rBZansiblerrZansible.executor.module_commonrZ)ansible.module_utils.parsing.convert_boolrZansible.plugins.actionrZansible.utils.varsr r rrrrs