Fix apt module loop to avoid deprecation notices

[DEPRECATION WARNING]: Invoking "apt" 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: ['php5.6-common',
'php7.0-common', 'php7.1-common', 'php7.2-common', 'php7.3-common']` 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.
This commit is contained in:
m.moraes 2019-04-09 03:14:58 +00:00
parent bf000f5535
commit 2ab1776af9
1 changed files with 1 additions and 7 deletions

View File

@ -46,14 +46,8 @@
# PHP package purges.
- name: Purge PHP version packages.
apt:
name: "{{ item }}"
name: ['php5.6-common', 'php7.0-common', 'php7.1-common', 'php7.2-common', 'php7.3-common']
state: absent
purge: true
force: true
with_items:
- php5.6-common
- php7.0-common
- php7.1-common
- php7.2-common
- php7.3-common
when: "'php' + php_version not in item"