# Apt packages

**URL:** <https://forum.ansible.com/t/apt-packages/21370>\
**Category:** Ansible Project\
**Tags:** ansible-project\
**Created:** [May 6, 2016, 8:58am UTC](https://forum.ansible.com/t/apt-packages/21370 "2016-05-06T08:58:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [May 6, 2016, 8:58am UTC](https://forum.ansible.com/t/apt-packages/21370/1 "2016-05-06T08:58:30Z")

</div>

Use something like this:

apt: name="{{ item }}" ...  
with\_items: your\_package\_list

and call the playbook with

ansible-playbook -e 'your\_package\_list=[foo,bar,xyz]'

Untested!

Johannes

---

<div class="post-metadata">

**Author:** ![Johannes\_Kastl](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@Johannes\_Kastl](https://forum.ansible.com/u/Johannes_Kastl)\
**Post date:** [May 6, 2016, 9:17am UTC](https://forum.ansible.com/t/apt-packages/21370/2 "2016-05-06T09:17:56Z")

</div>

Damn, I get the list thing wrong each time..

[https://docs.ansible.com/ansible/YAMLSyntax.html](https://docs.ansible.com/ansible/YAMLSyntax.html)  
fruits: ['Apple', 'Orange', 'Strawberry', 'Mango']

Try this: ansible-playbook -e "your\_package\_list=['foo','bar','xyz']"

Johannes

---

<div class="post-metadata">

**Author:** ![deorene](https://avatars.discourse-cdn.com/v4/letter/d/8dc957/32.png) [@deorene](https://forum.ansible.com/u/deorene)\
**Post date:** [May 6, 2016, 9:29am UTC](https://forum.ansible.com/t/apt-packages/21370/3 "2016-05-06T09:29:03Z")

</div>

Thanks, working now
