How to ignore files that can not be found as part of vars_files

Hi,

I need to upload 5 files as part of vars_files.

There is a chance that one of the files is missing and in this case i want to ignore it - How can i do that.

This is my solution for a single file , but how can i used it for 5 files

vars:

  • optional_1_vars_file: “{{ lookup(‘first_found’, ‘1.yml’, errors=‘ignore’) }}”
    tasks:
  • when: optional_1_vars_file is file
    include_vars: “{{ optional_1_vars_file }}”