votes up 1

Invalid vars_files entry found: %r vars_files entries should be either a string type or a list of string types after template expansion

Package:
ansible
github stars 49704
Exception Class:
AnsibleError

Raise code

rate through the (potential) files, and break out
                    # as soon as we read one from the list. If none are found, we
                    # raise an error, which is silently ignored at this point.
                    try:
                        for vars_file in vars_file_list:
                            vars_file = templar.template(vars_file)
                            if not (isinstance(vars_file, Sequence)):
                                raise AnsibleError(
                                    "Invalid vars_files entry found: %r\n"
                                    "vars_files entries should be either a string type or "
                                    "a list of string types after template expansion" % vars_file
                                )
                            try:
                                data = preprocess_vars(self._loader.load_from_file(vars_file, unsafe=True))
                                if data is not None:
                                
😲 Agile task management is now easier than calling a taxi. #Tracklify

Ways to fix

votes up 1 votes down

Verify that your play-level code is properly indented according to yaml syntax.

Check what comes immediately after the vars_files section on the play level. For example, forgetting to add "tasks:" after the vars_files section will lead ansible to attempt to read your tasks as vars_files, and fail with this exception because of the syntax differences.

Nov 23, 2021 victor.churikov answer

Add a possible fix

Please authorize to post fix