Ansible callback don't return errors

ansible

#1

Problem:
I need to manage errors from Ansible but when i execute playbook, no errors appear :

 1:

   2:
PLAY [Installation specifique de Docker-ce] ***********************************
   3:

   4:
TASK [Installation de docker-ce 18.06.3vzfzff~ce~3-0~debianfzfz] ***************
   5:
Exit status: 2

When i run playbook from CLI, Ansible return all the error, it’s only i want :

 fatal: [192.168.0.137]: FAILED! => {"changed": true, "cmd": "apt-get install -y --allow-downgrades docker-ce=18.06.3~ce~3-0~debianfzfz", "delta": "0:00:00.174857", "end": "2019-05-14 09:51:38.707406", "msg": "non-zero return code", "rc": 100, "start": "2019-05-14 09:51:38.532549", "stderr": "E: La version « 18.06.3~ce~3-0~debianfzfz » de « docker-ce » n'a pu être trouvée", "stderr_lines": ["E: La version « 18.06.3~ce~3-0~debianfzfz » de « docker-ce » n'a pu être trouvée"], "stdout": "Lecture des listes de paquets…\nConstruction de l'arbre des dépendances…\nLecture des informations d'état…", "stdout_lines": ["Lecture des listes de paquets…", "Construction de l'arbre des dépendances…", "Lecture des informations d'état…"]}
fatal: [10.0.0.4]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: connect to host 10.0.0.4 port 22: Connection timed

Versions
foreman-tasks 0.14.5
foreman_ansible 2.3.3
foreman_execution 1.7.0
Ansible 2.7.10
smart_proxy 1.21.2


#2

Try to configure this in /etc/ansible/ansible.cfg

'stdout_callback = yaml',

or other format that you prefer. This will be the deafult configuration from 1.22 (RC1 so far).


#3

Thank you. That solves my problem.