Add a stat task first and use the result to conditionally run the slurp task

On Tue, 27 Sep 2022 at 05:10, Shabir Abdul Samdh <shabirm...@gmail.com>
wrote:

> Hello All,
>
> I am trying to read a file from a remote host and do some checks on its
> content using the slurp module
> <https://docs.ansible.com/ansible/latest/collections/ansible/builtin/slurp_module.html>.
> However I want these checks to run only if the file exists. If the file is
> not found I want to skip some of the following tasks.
>
> However, it seems like the slurp module fails when the file I am looking
> for is not found. Is there a way to handle the case of a file not being
> there gracefully when using slurp?
>
> Thank you very much
> Best regards
> ---
> Shabir
>
> --
> 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-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAGK3r_gHYeG4_M1pqzNEX8pp182oUQaQgHYpxh7mtd_iuaekNw%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAGK3r_gHYeG4_M1pqzNEX8pp182oUQaQgHYpxh7mtd_iuaekNw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
-- 
Sent from Gmail Mobile

-- 
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAF8BbLZAcG6Povn9c5PG2eH3o2jw4JUacYZmS95my7QnSiCAbg%40mail.gmail.com.

Reply via email to