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

**URL:** <https://forum.ansible.com/t/install-multiple-named-packages-with-community-general-zypper/38449>\
**Category:** Ansible Project\
**Created:** [September 18, 2023, 8:16pm UTC](https://forum.ansible.com/t/install-multiple-named-packages-with-community-general-zypper/38449 "2023-09-18T20:16:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tlemons](https://avatars.discourse-cdn.com/v4/letter/t/edb3f5/32.png) [@tlemons](https://forum.ansible.com/u/tlemons)\
**Post date:** [September 18, 2023, 8:16pm UTC](https://forum.ansible.com/t/install-multiple-named-packages-with-community-general-zypper/38449/1 "2023-09-18T20:16:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [September 18, 2023, 8:19pm UTC](https://forum.ansible.com/t/install-multiple-named-packages-with-community-general-zypper/38449/2 "2023-09-18T20:19:55Z")

</div>

The way I read it ([https://docs.ansible.com/ansible/latest/collections/community/general/zypper\_module.html#parameter-name](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.

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [September 18, 2023, 8:27pm UTC](https://forum.ansible.com/t/install-multiple-named-packages-with-community-general-zypper/38449/3 "2023-09-18T20:27:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tlemons](https://avatars.discourse-cdn.com/v4/letter/t/edb3f5/32.png) [@tlemons](https://forum.ansible.com/u/tlemons)\
**Post date:** [September 19, 2023, 1:33pm UTC](https://forum.ansible.com/t/install-multiple-named-packages-with-community-general-zypper/38449/4 "2023-09-19T13:33:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [September 19, 2023, 3:49pm UTC](https://forum.ansible.com/t/install-multiple-named-packages-with-community-general-zypper/38449/5 "2023-09-19T15:49:50Z")

</div>

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](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
