# List of items in deb parameter of apt module

**URL:** <https://forum.ansible.com/t/list-of-items-in-deb-parameter-of-apt-module/30144>\
**Category:** Ansible Project\
**Created:** [April 18, 2019, 8:41am UTC](https://forum.ansible.com/t/list-of-items-in-deb-parameter-of-apt-module/30144 "2019-04-18T08:41:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![f.floimair.commend](https://avatars.discourse-cdn.com/v4/letter/f/3da27b/32.png) [@f.floimair.commend](https://forum.ansible.com/u/f.floimair.commend)\
**Post date:** [April 18, 2019, 8:41am UTC](https://forum.ansible.com/t/list-of-items-in-deb-parameter-of-apt-module/30144/1 "2019-04-18T08:41:37Z")

</div>

Hi!

Since the with\_items are going to be deprecated and following the porting guide here: [https://docs.ansible.com/ansible/latest/porting\_guides/porting\_guide\_2.7.html](https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.7.html)  
I tried to rewrite some of my tasks where I am installing debian packages to use list format (which works with packages that come from a debian repository in the name parameter), but ran into an issue.

It seems that the deb parameter does not work with lists.

This is what I have (and works)

- name: Install local .deb-packages  
apt:  
deb: “{{ item }}”  
state: present  
with\_items:

- “/some/path/packet\_A.deb”

- “/some/path/packet\_B.deb”

and this is what I tried to do (which fails)

- name: Install local .deb-packages  
apt:  
deb:

- “/some/path/packet\_A.deb”

- “/some/path/packet\_B.deb”

state: present

Did I misunderstand something or is this an open issue in the apt module that needs to be fixed before deprecating the with\_items variant?

Thanks for your help in advance!

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [April 18, 2019, 10:05am UTC](https://forum.ansible.com/t/list-of-items-in-deb-parameter-of-apt-module/30144/2 "2019-04-18T10:05:57Z")

</div>

The apt module does not have a "deb" parameter. Use "name" instead.

[https://docs.ansible.com/ansible/latest/modules/apt\_module.html](https://docs.ansible.com/ansible/latest/modules/apt_module.html)

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [April 18, 2019, 10:13am UTC](https://forum.ansible.com/t/list-of-items-in-deb-parameter-of-apt-module/30144/3 "2019-04-18T10:13:01Z")

</div>

Sorry, too fast. There is a deb parameter!

But according to  
[https://docs.ansible.com/ansible/latest/modules/apt\_module.html](https://docs.ansible.com/ansible/latest/modules/apt_module.html) that  
parameter does not support a list argument.  
The "name" parameter does.  
The porting guide says this explicitly:  
"Instead of relying on implicit squashing, tasks should instead supply  
the list directly to the name, pkg or package parameter of the  
module."

So if you need to iterate over a list of local deb files, you'd still  
have to do it in a loop.

Dick
