# yum command and variable fed to with\_items

**URL:** <https://forum.ansible.com/t/yum-command-and-variable-fed-to-with-items/13627>\
**Category:** Ansible Project\
**Created:** [October 8, 2013, 8:27am UTC](https://forum.ansible.com/t/yum-command-and-variable-fed-to-with-items/13627 "2013-10-08T08:27:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marc\_Trudel](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@Marc\_Trudel](https://forum.ansible.com/u/Marc_Trudel)\
**Post date:** [October 8, 2013, 8:27am UTC](https://forum.ansible.com/t/yum-command-and-variable-fed-to-with-items/13627/1 "2013-10-08T08:27:05Z")

</div>

Greetings,

I am trying to copy a number of packages to a remote machine for install using something like this:

[https://gist.github.com/stelcheck/6881400](https://gist.github.com/stelcheck/6881400)

For some reason, the copy iterates over the elements in the packages variable, but yum does the following:

_\<172.16.0.112\> REMOTE\_MODULE yum name=/tmp/collectd,libcollectdclient,collectd-amqp,collectd-ascent,collectd-bind,collectd-collection3,collectd-curl,collectd-curl\_json,collectd-curl\_xml,collectd-dns,collectd-hddtemp,collectd-iptables,collectd-libvirt,collectd-lvm,collectd-memcachec,collectd-mysql,collectd-ping,collectd-python,collectd-rrdtool,collectd-sensors-5.4.0-1.el6.x86\_64.rpm enablerepo=epel state=present state=latest_

I don’t see what the behavior should be different between copy and yum?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [October 8, 2013, 3:04pm UTC](https://forum.ansible.com/t/yum-command-and-variable-fed-to-with-items/13627/2 "2013-10-08T15:04:24Z")

</div>

The yum module is explicitly coded to install things in a single transaction, as is the apt module, and a few others in ansible.

Generally speaking this is _very desirable_, have you hit a specific problem?

---

<div class="post-metadata">

**Author:** ![Marc\_Trudel](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@Marc\_Trudel](https://forum.ansible.com/u/Marc_Trudel)\
**Post date:** [October 9, 2013, 8:00am UTC](https://forum.ansible.com/t/yum-command-and-variable-fed-to-with-items/13627/3 "2013-10-09T08:00:44Z")

</div>

I do this normally, but for some reason, when I specify an array as a variable, it looks like it array\_joins the array. When I specify an array, I do not have this problem.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [October 9, 2013, 1:07pm UTC](https://forum.ansible.com/t/yum-command-and-variable-fed-to-with-items/13627/4 "2013-10-09T13:07:14Z")

</div>

Yes, with\_items when given to yum will specify everything joined by commas and pass it in, because the module understands this.

This is intended behavior and very specifically coded to do this, so you don’t have to hop into the system 50 times to install 50 packages.

I’m asking _why_ this is a problem as I’m failing to understand what the user scenario is in what you are doing is not working.
