Add a stat task first and only include the file if it's there

On Sun, 18 Jul 2021 at 14:46, [email protected] <[email protected]>
wrote:

> - hosts: server1
>   vars_files:
>     - main.yml
>     - second.yml
>
>
>
> Hi,
>
> I have a a small playbook that is using variables based on a file.
>
> Main.yml the file will always exist while second.yml might exist.
>
>
>
>
>
> 1.       Is it possible to configure the playbook to continue in case
> second.yml file does not existt?
>
> 2.       If I will add to the main. yam the following value
>
>               Additional_file: yes
>
>    Can I configure the playbook to load second.yml only in case
> Additional_file value = yes
>
>
>
> Thanks
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/c5f132d2-745e-454a-8a62-bea207121f23n%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/c5f132d2-745e-454a-8a62-bea207121f23n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
-- 
Sent from a mobile device - please excuse the brevity, spelling and
punctuation.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwMK8UxeZq1zBA1QACLMw0tNUXa5PTou%2B7gZZPEtw_QxQg%40mail.gmail.com.

Reply via email to