Don't show all ansible output only show msg output on the console

I have a playbook with bunch of tasks, I am running that playbook on jenkins and all my tasks are working fine. I just don’t want all the output to be seen on the screen except the debug msg. Hoc can I achieve this.

TASK [Save Repo Names to File] ************************************************* changed: [localhost] TASK [Filter Repo Names] ******************************************************* ok: [localhost] TASK [Debug Job Info] ********************************************************** ok: [localhost] => { “repos_list”: [ “repo1” ] }

I just need only this

TASK [when jenkins job is created] ********************************************* ok: [localhost] => (item={‘project’: ‘itapps’, ‘repo’: ‘repo1’, ‘scmUrl’: ‘https://github.com’}) => { “msg”: “{ Job doesn’t exist on any of the jenkins so Created the job on https://<jenkinsbuild.com> } \n” }

you could do no_log: true

Or just use a custom callback that only outputs debug entries.

how would that look like practically?

Simple example, if you just want to override task output:

    def v2_runner_on_ok(self, result):
         if result._task.action != 'debug':
            return
       ....