
    Vh                    N    d dl mZ d dlmZmZ d dlmZ d dlmZ  G d de      Z	y)    )annotations)AnsibleActionAnsibleActionFail)get_action_args_with_defaults)
ActionBasec                  D     e Zd ZdZdg diZ eg d      Zd fd	Z xZS )ActionModuleFsystemd)patternrunlevelsleep	argumentsargs)openwrt_initservicer
   sysvinitc                n   d| _         d| _        t        t        |   ||      }~| j
                  j                  j                  dd      j                         }|dk(  re	 | j
                  j                  r3| j                  j                  d| j
                  j                  z        }n| j                  j                  d      }	 |dk(  r_| j                  dt        dd	      |
      }| j                  j!                  d|z         |j                  di       j                  dd      }|r*|dk(  s%| j"                  j$                  j'                  |      sd}|dk7  r|| j
                  j                  j)                         }d|v r|d= || j*                  v r>| j*                  |   D ],  }||v s||= | j                  j-                  d|d|d       . | j"                  j$                  j/                  || j
                  j0                        }t3        |j4                  || j
                  j6                  | j                  | j
                  j8                  j:                  j<                        }|| j>                  v rd|z   }| j                  jA                  d|z         |jC                  | j                  |||| j
                  jD                               ntG        d      	 | j
                  jD                  s/| jM                  | jN                  jP                  jR                         |S # t        $ r Y tw xY w# tH        $ r%}	|jC                  |	jJ                         Y d}	~	d}	~	ww xY w# | j
                  jD                  s0| jM                  | jN                  jP                  jR                         w w xY w)z  handler for package operations Tuseautoz2{{hostvars['%s']['ansible_facts']['service_mgr']}}z{{ansible_facts.service_mgr}}zansible.legacy.setupz!allansible_service_mgr)gather_subsetfilter)module_namemodule_args	task_varszFacts %sansible_factszansible.legacy.servicez
Ignoring "z" as it is not used in "")collection_list)action_groupszansible.legacy.z
Running %s)r   r   r   
wrap_asyncz_Could not detect which service manager to use. Try gathering facts or setting the "use" option.N)*_supports_check_mode_supports_asyncsuperr	   run_taskr   getlowerdelegate_to_templartemplate	Exception_execute_moduledict_displaydebug_shared_loader_objmodule_loader
has_plugincopyUNUSED_PARAMSwarningfind_plugin_with_contextcollectionsr   resolved_fqcnmodule_defaults_parent_play_action_groupsBUILTIN_SVC_MGR_MODULESvvvvupdate	async_valr   r   result_remove_tmp_path_connection_shelltmpdir)selftmpr   rA   modulefactsnew_module_argsunusedcontexte	__class__s             N/home/dcms/DCMS/lib/python3.12/site-packages/ansible/plugins/action/service.pyr$   zActionModule.run%   s    %)!#|T.sI>$$UF399;V::))!]]334hkokuku  lB  lB  5B  CF!]]334STF+	F,, 6 $6BW Xdm - o ##J$67?B7;;<QSYZVv-T5L5L5Z5Z5e5efl5m1"&**//"6"6"8O+'.T///"&"4"4V"< p!_4 / 7 MM11_egm2nop 11??XXY_quq{q{  rH  rHX  I"?))?DJJ<V<VX\XeXe"&**"4"4":":"I"I# T999.7F""<&#89d22vSbnw  EI  EO  EO  EY  EY2  Z  ['  )J  K  K [ ::''%%d&6&6&=&=&D&DEa  T  	$MM!((##	$ ::''%%d&6&6&=&=&D&DE (sL   A$L+ C'L; ,D7L; #M, +	L87L8;	M)M$M, $M))M, ,AN4)NN)	__name__
__module____qualname__TRANSFERS_FILESr4   setr=   r$   __classcell__)rN   s   @rO   r	   r	      s1    O 	HM ""TUA A    r	   N)

__future__r   ansible.errorsr   r   ansible.executor.module_commonr   ansible.plugins.actionr   r	    rV   rO   <module>r\      s#   " # < H -M: MrV   