diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml index 35d2d7d..eae2eb0 100644 --- a/tasks/setup-Debian.yml +++ b/tasks/setup-Debian.yml @@ -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" diff --git a/vars/Debian.yml b/vars/Debian.yml index 5a7b475..936f1d1 100644 --- a/vars/Debian.yml +++ b/vars/Debian.yml @@ -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