a )g@srddlmZmZmZeZddlmZmZddl m Z ddl m Z ddl mZddlmZeZGdddeZd S) )absolute_importdivisionprint_function) AnsibleActionAnsibleActionFail)get_action_args_with_defaults)PKG_MGRS) ActionBase)Displaycs0eZdZdZddeDZdfdd ZZS) ActionModuleFcCsh|] }|dqS)name).0Zmanagerr r B/usr/lib/python3.9/site-packages/ansible/plugins/action/package.py !zActionModule.Nc sd|_d|_tt|||}~|jjdd}|dkrzz.|jjrX|j d|jj}n |j d}Wnt yxYn0z\z|dkr|j dt ddd |d }td ||d idd}|dkr~|jj|std |n|jj}d|vr|d=|jjj||jjd}t|j||jj|j |jjjjd}||jvrRd|}td|||j ||||jj dntdWn2t!y}z||j"WYd}~n d}~00W|jj s|#|j$j%j&n|jj s|#|j$j%j&0|S)z handler for package operations TZuseautoz.{{hostvars['%s']['ansible_facts']['pkg_mgr']}}z{{ansible_facts.pkg_mgr}}zansible.legacy.setupZansible_pkg_mgrz!all)filterZ gather_subset) module_name module_args task_varszFacts %sZ ansible_factszCould not find a module for %s.)Zcollection_list)Z action_groupszansible.legacy.z Running %s)rrrZ wrap_asyncz_Could not detect which package manager to use. Try gathering facts or setting the "use" option.N)'Z_supports_check_modeZ_supports_asyncsuperr runZ_taskargsgetZ delegate_toZ_templartemplate ExceptionZ_execute_moduledictdisplaydebugZ_shared_loader_objZ module_loaderZ has_pluginrcopyZfind_plugin_with_context collectionsrZ resolved_fqcnZmodule_defaultsZ_parentZ_play_action_groupsBUILTIN_PKG_MGR_MODULESZvvvvupdateZ async_valrresultZ_remove_tmp_pathZ _connectionZ_shellZtmpdir) selftmprr%moduleZfactsZnew_module_argscontexte __class__r rr#sX        $  zActionModule.run)NN)__name__ __module__ __qualname__ZTRANSFERS_FILESrr#r __classcell__r r r+rr sr N)Z __future__rrrtypeZ __metaclass__Zansible.errorsrrZansible.executor.module_commonrZ)ansible.module_utils.facts.system.pkg_mgrrZansible.plugins.actionr Zansible.utils.displayr rr r r r rs