# Ansible 2.7 - what replace yum+with\_lines'

**URL:** <https://forum.ansible.com/t/ansible-2-7-what-replace-yum-with-lines/29201>\
**Category:** Ansible Project\
**Created:** [December 5, 2018, 2:37pm UTC](https://forum.ansible.com/t/ansible-2-7-what-replace-yum-with-lines/29201 "2018-12-05T14:37:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shlomit\_Afgin](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@Shlomit\_Afgin](https://forum.ansible.com/u/Shlomit_Afgin)\
**Post date:** [December 5, 2018, 2:37pm UTC](https://forum.ansible.com/t/ansible-2-7-what-replace-yum-with-lines/29201/1 "2018-12-05T14:37:00Z")

</div>

Hi,

I update Ansible to 2.7.

Now when I run it I get deprecated warning.

I trying to install with yum the packages that list in the file yum\_packages.txt

I have:

`

- name: install Basic Packages to specific version

yum:

name: “{{item}}”

state: present

skip\_broken: yes

with\_lines: cat /etc/ansible/path/files/yum\_packages.txt

`

I got an error:

> [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: {{item}}`, please use `name:
> 
> u’cat /etc/ansible/path/files/yum\_packages.txt’` 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.

I tried to rewrite it but I did not success.

How can I replace code so it will work with Ansible 2.7 with no deprecated warning?

Thanks.

---

<div class="post-metadata">

**Author:** ![Jonathan\_Lozada\_De\_L](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jonathan\_Lozada\_De\_L](https://forum.ansible.com/u/Jonathan_Lozada_De_L)\
**Post date:** [December 5, 2018, 2:40pm UTC](https://forum.ansible.com/t/ansible-2-7-what-replace-yum-with-lines/29201/2 "2018-12-05T14:40:16Z")

</div>

check your ansible.cfg there’s an option to squash the loop/list in one line. Just remove that.

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [December 5, 2018, 3:15pm UTC](https://forum.ansible.com/t/ansible-2-7-what-replace-yum-with-lines/29201/3 "2018-12-05T15:15:52Z")

</div>

You can pretty much update it to be:

yum:  
name: “{{ lookup(‘lines’, ‘cat /etc/ansible/path/files/yum\_packages.txt’) }}”

The message indicating it looks a little misleading there. I’ll look to see if there is a way to improve it at all.
