mirror of
https://github.com/geerlingguy/ansible-role-php-versions.git
synced 2024-11-22 10:25:40 +01:00
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:
commit
819bf74b1e
@ -46,8 +46,9 @@
|
||||
# PHP package purges.
|
||||
- name: Purge PHP version packages.
|
||||
apt:
|
||||
name: ['php5.6-common', 'php7.0-common', 'php7.1-common', 'php7.2-common', 'php7.3-common']
|
||||
name: "{{ __php_versions_debian |
|
||||
reject('search', 'php' ~ php_version) |
|
||||
list }}"
|
||||
state: absent
|
||||
purge: true
|
||||
force: true
|
||||
when: "'php' + php_version not in item"
|
||||
|
@ -37,3 +37,10 @@ __php_packages:
|
||||
- "php{{ php_version }}-sqlite3"
|
||||
- "php{{ php_version }}-xml"
|
||||
- "php{{ php_version }}-yaml"
|
||||
|
||||
__php_versions_debian:
|
||||
- php5.6-common
|
||||
- php7.0-common
|
||||
- php7.1-common
|
||||
- php7.2-common
|
||||
- php7.3-common
|
||||
|
Loading…
Reference in New Issue
Block a user