a )g @sHddlmZmZmZeZdZddlmZddl m Z GdddeZ dS))absolute_importdivisionprint_functiona name: minimal type: stdout short_description: minimal Ansible screen output version_added: historical description: - This is the default output callback used by the ansible command (ad-hoc) extends_documentation_fragment: - result_format_callback ) CallbackBase) constantsc@sNeZdZdZdZdZdZddZddd Zd d Z d d Z ddZ ddZ dS)CallbackModulez This is the default callback interface, which simply prints messages to stdout when new callback events are received. g@stdoutZminimalcCsNd|||ddf}||dd7}||dd7}||dd7}|dS) z$ output the result of a command run z%s | %s | rc=%s >> rcrstderrmsg )get)selfhostresultZcaptionbufrD/usr/lib/python3.9/site-packages/ansible/plugins/callback/minimal.py_command_generic_msg#s z#CallbackModule._command_generic_msgFcCs||j||j|jjtjvrVd|jvrV|jj| |j |jdtj dn,|jjd|j |j |jddftj ddS)NZ module_stderrZFAILEDcolorz%s | FAILED! => %sindent)Z_handle_exception_result_handle_warnings_taskactionCMODULE_NO_JSON_displaydisplayr_hostget_nameZ COLOR_ERROR _dump_results)rr ignore_errorsrrrv2_runner_on_failed-s   &z"CallbackModule.v2_runner_on_failedcCs||j|jj||j|jddr8tj}d}n tj}d}|jjtj vr~d|jvr~|j j | |j |j||dn,|j j d|j ||j|jdd f|ddS) NZchangedFZCHANGEDSUCCESSZansible_job_idrz %s | %s => %srr)Z_clean_resultsrrrrrr Z COLOR_CHANGEDZCOLOR_OKr!r"r#rr$r%r&)rrrstaterrrv2_runner_on_ok7s $zCallbackModule.v2_runner_on_okcCs |jjd|jtjddS)Nz %s | SKIPPEDr)r"r#r$r%r Z COLOR_SKIPrrrrrv2_runner_on_skippedHsz#CallbackModule.v2_runner_on_skippedcCs0|jjd|j|j|jddftjddS)Nz%s | UNREACHABLE! => %srrr)r"r#r$r%r&rr ZCOLOR_UNREACHABLEr,rrrv2_runner_on_unreachableKsz'CallbackModule.v2_runner_on_unreachablecCs0d|jvr,|jdr,|j||jddS)Ndiff)rr"r#Z _get_diffr,rrrv2_on_file_diffNszCallbackModule.v2_on_file_diffN)F) __name__ __module__ __qualname____doc__ZCALLBACK_VERSIONZ CALLBACK_TYPEZ CALLBACK_NAMErr(r+r-r.r0rrrrrs rN) Z __future__rrrtypeZ __metaclass__Z DOCUMENTATIONZansible.plugins.callbackrZansiblerr rrrrrs