# Ansible 2.8.2 - yum list of local packages

**URL:** <https://forum.ansible.com/t/ansible-2-8-2-yum-list-of-local-packages/34352>\
**Category:** Ansible Project\
**Created:** [December 18, 2020, 3:40am UTC](https://forum.ansible.com/t/ansible-2-8-2-yum-list-of-local-packages/34352 "2020-12-18T03:40:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ty\_Smith](https://avatars.discourse-cdn.com/v4/letter/t/77aa72/32.png) [@Ty\_Smith](https://forum.ansible.com/u/Ty_Smith)\
**Post date:** [December 18, 2020, 3:40am UTC](https://forum.ansible.com/t/ansible-2-8-2-yum-list-of-local-packages/34352/1 "2020-12-18T03:40:32Z")

</div>

I get a deprecation warning when running the below task when using yum module with local install. The variable “packages” comes from vars/centos\_6.yml

**\*\*\*\* This Works but provides deprecated warning \*\*\*\***

- name: Include vars for host distribution  
include\_vars: “{{ ansible\_distribution|lower }}\_{{ ansible\_distribution\_major\_version }}.yml”

- name: Install the package  
yum:  
name: “/var/tmp/{{item}}”  
state: present  
when: ansible\_os\_family == ‘RedHat’  
with\_items:

- “{{packages}}”

TASK [install : Install the package] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
[DEPRECATION WARNING]: Invoking “yum” only once while using a loop via squash\_actions is deprecated. Instead of using a  
loop to supply multiple items and specifying `name: "/var/tmp/{{item}}"`, please use `name: ['{{ packages }}']` and  
remove the loop. This feature will be removed in version 2.11. Deprecation warnings can be disabled by setting  
deprecation\_warnings=False in ansible.cfg.  
changed: [[servername.net](http://servername.net)] =\> (item=[u’/var/tmp/filename.el7.x86\_64.rpm’])
