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.