source input from a file (exp: package names and versions from an excel or a csv)

I’m looking for a way to input names of packages (around 100+ packages - actually it’s dynamic) and allow ansible to run a playbook against these packages (update or install etc). I can’t seem to find anyway except by adding all the filenames into the playbook everytime using variables. Is there a better way to do it?

Regards,
Saga

you could use lookup('file', ...) and/or lookup('csvfile',) either
directly or using with_<lookup plugin>