Print error possibility #1

Closed
opened 2023-07-25 13:20:38 +00:00 by nicolas-morel · 3 comments

Hi,

There is a solution to print the error message with 1 of a playbook failed ?

$ ansible-parallel test*.yml 
test1.yml: Done.
test2.yml: Exited with error code: 2
test3.yml: Done.
test.yml:  Done.
# Playbook test3.yml, ran in 1s
localhost                  : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   


# Playbook test1.yml, ran in 1s
localhost                  : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   


# Playbook test2.yml, ran in 1s
localhost                  : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   


# Playbook test.yml, ran in 1s
localhost                  : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

But i don't have error message on test2.yml, when I launch individually the playbook i have this message:

TASK [test : Print var] **************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'msg' is undefined. 'msg' is undefined\n\nThe error appears to be in '/home/nmorel/WorkDir/temp/ansible-parrallel/roles/test/tasks/main.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: Print var\n  ^ here\n"}

Thank

Hi, There is a solution to print the error message with 1 of a playbook failed ? ``` $ ansible-parallel test*.yml test1.yml: Done. test2.yml: Exited with error code: 2 test3.yml: Done. test.yml: Done. # Playbook test3.yml, ran in 1s localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 # Playbook test1.yml, ran in 1s localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 # Playbook test2.yml, ran in 1s localhost : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 # Playbook test.yml, ran in 1s localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 ``` But i don't have error message on test2.yml, when I launch individually the playbook i have this message: ``` TASK [test : Print var] ************************************************************************************************************************************** fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'msg' is undefined. 'msg' is undefined\n\nThe error appears to be in '/home/nmorel/WorkDir/temp/ansible-parrallel/roles/test/tasks/main.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: Print var\n ^ here\n"} ``` Thank
Owner

Bonjour Nicolas,

Would you mind testing the mdk-failed-is-error branch?

You can do it very easily by using:

pip install --force-reinstall git+https://git.afpy.org/mdk/ansible-parallel@mdk-failed-is-error

If it works for you I'll shoot a release.

Bonjour Nicolas, Would you mind testing the `mdk-failed-is-error` branch? You can do it very easily by using: pip install --force-reinstall git+https://git.afpy.org/mdk/ansible-parallel@mdk-failed-is-error If it works for you I'll shoot a release.
Author

Hi @mdk

I begin to work on a fork to submit you a PR, but i've got the same result as you.
It's work fine for me I think you can push the release

Thank you !

Hi @mdk I begin to work on a fork to submit you a PR, but i've got the same result as you. It's work fine for me I think you can push the release Thank you !
Owner
Here you go: https://pypi.org/project/ansible-parallel/2023.7.26/ Bonne journée !
mdk closed this issue 2023-07-26 09:10:37 +00:00
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mdk/ansible-parallel#1
No description provided.