Install multiple named packages with 'community.general.zypper'

Hi - I need to install ~30 specific packages on a SLES 15 system using Ansible. Instead of specifying 30 individual ‘community.general.zypper’ tasks, I’d like to run a single ‘community.general.zypper’ task and provide it either with a long list of packages or a filename containing the package list. This doesn’t seem to be possible, given my read of the ‘community.general.zypper’ documentation; is that true?

Thanks!
tl

The way I read it (https://docs.ansible.com/ansible/latest/collections/community/general/zypper_module.html#parameter-name), that is not true.
It is possible to supply a list:

Package name name or package specifier or a list of either.

It is possible. If not within the the module use with_items or loops. Give zypper a list

Hi Wei-Yen and Dick

Thank you both for the fast replies. I found that multiple packages are support as a value to ‘Name’, but the values must be comma-separated.

Thanks again!
tl

Hi tl,

you can also provide a YAML list.

See the documentation: it explicitly says `list / elements=string`.
https://docs.ansible.com/ansible/latest/collections/community/general/zypper_module.html#parameter-name

Providing a comma-separated string instead of a list is something
Ansible allows, but you do not have to do that.

Cheers,
Felix