# Install packages with specific versions in single transaction

**URL:** <https://forum.ansible.com/t/install-packages-with-specific-versions-in-single-transaction/19783>\
**Category:** Ansible Project\
**Created:** [November 17, 2015, 2:43pm UTC](https://forum.ansible.com/t/install-packages-with-specific-versions-in-single-transaction/19783 "2015-11-17T14:43:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniil1](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@Daniil1](https://forum.ansible.com/u/Daniil1)\
**Post date:** [November 17, 2015, 2:43pm UTC](https://forum.ansible.com/t/install-packages-with-specific-versions-in-single-transaction/19783/1 "2015-11-17T14:43:04Z")

</div>

Hello.

As [documentation says](http://docs.ansible.com/ansible/playbooks_loops.html#standard-loops) I can write construction like that:

`  
apt: name={{ item }} state=present  
with\_items:

- package1
- package2  
`

and have single transaction to package management system:

`ok: [foo.bar] => (item=package1,package2)`

My **question is** how can I install multiple (many in fact) packages with specific versions still in one transaction?  
Approach with ‘with\_dict’ loop

`

- apt: name={{ item.key }}={{ item.value }} state=present  
with\_dict: “{{many\_many\_packages}}”  
`  
still generates one command per key in dictionary.

Thank in advance, Daniil.
