You use "register: myVariable" on the shell task, then "when:
myVariable.stdout == XY" on the next task.

https://www.mydailytutorials.com/ansible-register-variables/

//magnus

On Fri, Jul 3, 2020 at 1:51 PM Amir Alavi <amir.rafiep...@gmail.com> wrote:

> Hi all,
>
> Newbie here - I'm writing a playbook that I'm running a shell script and
> if the output is X then I want to skip the task and move on to the next
> task.
> How do I do this?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-devel/1645749e-5baa-4eba-91c5-0f24aa601d18o%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-devel/1645749e-5baa-4eba-91c5-0f24aa601d18o%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/CACOXixTgfXjZQDF27T22ay76YjLu_jwEN9WhdVu%3D-OvngPP5Cw%40mail.gmail.com.

Reply via email to