a )g@sTddlmZmZmZeZddlmZmZddl m Z ddl m Z Gddde Z dS))absolute_importdivisionprint_function) AnsibleActionAnsibleActionFail)get_action_args_with_defaults) ActionBasecs:eZdZdZdgdiZegdZdfdd ZZS) ActionModuleFsystemd)patternZrunlevelsleepZ argumentsargs)Z openwrt_initZservicer ZsysvinitNc sFd|_d|_tt|||}~|jjdd}|dkr~z.|jj r\|j d|jj }n |j d}Wnt y|Yn0zzP|dkr|j dtddd |d }|jd ||d idd}|r|dks|jj|sd }|dkr|jj}d|vr|d=||jvrP|j|D]*}||vr$||=|jd||fq$|jjj||jjd}t|j||jj|j |jjjjd}||jvrd|}|j d||!|j ||||jj"dnt#dWn2t$y} z|!| j%WYd} ~ n d} ~ 00W|jj"sB|&|j'j(j)n|jj"s@|&|j'j(j)0|S)z handler for package operations TZuseautoz2{{hostvars['%s']['ansible_facts']['service_mgr']}}z{{ansible_facts.service_mgr}}zansible.legacy.setupz!allZansible_service_mgr)Z gather_subsetfilter) module_name module_args task_varszFacts %sZ ansible_factszansible.legacy.servicez'Ignoring "%s" as it is not used in "%s")Zcollection_list)Z action_groupszansible.legacy.z Running %s)rrrZ wrap_asyncz_Could not detect which service manager to use. Try gathering facts or setting the "use" option.N)*Z_supports_check_modeZ_supports_asyncsuperr runZ_taskr getlowerZ delegate_toZ_templartemplate ExceptionZ_execute_moduledictZ_displaydebugZ_shared_loader_objZ module_loaderZ has_plugincopy UNUSED_PARAMSZwarningZfind_plugin_with_context collectionsrZ resolved_fqcnZmodule_defaultsZ_parentZ_play_action_groupsBUILTIN_SVC_MGR_MODULESZvvvvupdateZ async_valrrresultZ_remove_tmp_pathZ _connectionZ_shellZtmpdir) selftmprr!moduleZfactsZnew_module_argsZunusedcontexte __class__B/usr/lib/python3.9/site-packages/ansible/plugins/action/service.pyr&s`          $  zActionModule.run)NN) __name__ __module__ __qualname__ZTRANSFERS_FILESrsetrr __classcell__r)r)r'r*r s  r N)Z __future__rrrtypeZ __metaclass__Zansible.errorsrrZansible.executor.module_commonrZansible.plugins.actionrr r)r)r)r*s