Im getting a return code error but command runs but it shows up as failed please help!

33 views
Skip to first unread message

Jay Kumar

unread,
Feb 8, 2023, 7:50:59 PM2/8/23
to Ansible Project
pic (2).png
I'm getting a return code of 3, my shell module runs and the output is what im expecting but it still shows up as failed, here is an image of it. I also do not want to use ignore_error for this.

Thank you in advance,

Dick Visser

unread,
Feb 9, 2023, 1:27:50 AM2/9/23
to ansible...@googlegroups.com
Please copy and paste the text, and do not post screens caps. 

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a690e8b1-3810-42f3-bd0d-020b874bef9en%40googlegroups.com.
--
Sent from Gmail Mobile

Todd Lewis

unread,
Feb 9, 2023, 9:52:14 AM2/9/23
to Ansible Project
You said it yourself: "I'm getting a return code of 3".
The shell module will set `failed: true` if the script's rc is not 0.

Jay Kumar

unread,
Feb 9, 2023, 4:51:13 PM2/9/23
to Ansible Project
I was able to fix it with a failed when: var.stderr | count > 0

On Wednesday, February 8, 2023 at 7:50:59 PM UTC-5 Jay Kumar wrote:
Reply all
Reply to author
Forward
0 new messages