diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml index 18506a790..f9cf3d664 100644 --- a/provisioning/requirements.yml +++ b/provisioning/requirements.yml @@ -56,7 +56,7 @@ - src: geerlingguy.php-tideways version: 2.2.0 - src: geerlingguy.php-versions - version: 3.0.0 + version: 3.1.0 - src: geerlingguy.php-xdebug version: 2.5.1 - src: geerlingguy.php-xhprof diff --git a/provisioning/roles/geerlingguy.php-versions/.ansible-lint b/provisioning/roles/geerlingguy.php-versions/.ansible-lint new file mode 100644 index 000000000..f7ae1c6d1 --- /dev/null +++ b/provisioning/roles/geerlingguy.php-versions/.ansible-lint @@ -0,0 +1,3 @@ +skip_list: + - '306' + - '503' diff --git a/provisioning/roles/geerlingguy.php-versions/README.md b/provisioning/roles/geerlingguy.php-versions/README.md index 6e38be208..f639b3509 100644 --- a/provisioning/roles/geerlingguy.php-versions/README.md +++ b/provisioning/roles/geerlingguy.php-versions/README.md @@ -12,7 +12,7 @@ N/A Available variables are listed below, along with default values (see `defaults/main.yml`): - php_version: '7.7' + php_version: '7.2' The PHP version to be installed. Any [currently-supported PHP major version](http://php.net/supported-versions.php) is a valid option (e.g. `5.6`, `7.1`, `7.2`, `7.3`, etc.). diff --git a/provisioning/roles/geerlingguy.php-versions/molecule/default/playbook-7.1.yml b/provisioning/roles/geerlingguy.php-versions/molecule/default/playbook-7.1.yml index d9b5f5aed..6cf74deb1 100644 --- a/provisioning/roles/geerlingguy.php-versions/molecule/default/playbook-7.1.yml +++ b/provisioning/roles/geerlingguy.php-versions/molecule/default/playbook-7.1.yml @@ -20,5 +20,5 @@ post_tasks: - name: Confirm PHP version is correct. - shell: "php -v | grep -F '{{ php_version }}'" + shell: php -v | grep -F '{{ php_version }}' changed_when: false diff --git a/provisioning/roles/geerlingguy.php-versions/molecule/default/playbook-7.3.yml b/provisioning/roles/geerlingguy.php-versions/molecule/default/playbook-7.3.yml index b16c47f82..e6e55ca59 100644 --- a/provisioning/roles/geerlingguy.php-versions/molecule/default/playbook-7.3.yml +++ b/provisioning/roles/geerlingguy.php-versions/molecule/default/playbook-7.3.yml @@ -20,5 +20,5 @@ post_tasks: - name: Confirm PHP version is correct. - shell: "php -v | grep -F '{{ php_version }}'" + shell: php -v | grep -F '{{ php_version }}' changed_when: false diff --git a/provisioning/roles/geerlingguy.php-versions/molecule/default/playbook.yml b/provisioning/roles/geerlingguy.php-versions/molecule/default/playbook.yml index ccef7323a..6ae3076f8 100644 --- a/provisioning/roles/geerlingguy.php-versions/molecule/default/playbook.yml +++ b/provisioning/roles/geerlingguy.php-versions/molecule/default/playbook.yml @@ -20,5 +20,5 @@ post_tasks: - name: Confirm PHP version is correct. - shell: "php -v | grep -F '{{ php_version }}'" + shell: php -v | grep -F '{{ php_version }}' changed_when: false diff --git a/provisioning/roles/geerlingguy.php-versions/tasks/setup-Debian.yml b/provisioning/roles/geerlingguy.php-versions/tasks/setup-Debian.yml index ee4cbcd4b..85b2a590e 100644 --- a/provisioning/roles/geerlingguy.php-versions/tasks/setup-Debian.yml +++ b/provisioning/roles/geerlingguy.php-versions/tasks/setup-Debian.yml @@ -38,19 +38,14 @@ - name: Update apt caches after repo is added (Debian). apt: update_cache=true - when: php_ondrej_debian_repo.changed and (ansible_distribution == "Debian") + when: + - php_ondrej_debian_repo.changed + - ansible_distribution == "Debian" + tags: ['skip_ansible_lint'] -# PHP package purges. -- name: Purge PHP version packages. +- name: Purge PHP version packages (besides the currently chosen php_version). apt: - name: "{{ item }}" + name: "{{ php_versions_debian | reject('search', 'php' ~ php_version) | list }}" 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" diff --git a/provisioning/roles/geerlingguy.php-versions/vars/Debian.yml b/provisioning/roles/geerlingguy.php-versions/vars/Debian.yml index 5a7b475d1..fe4552029 100644 --- a/provisioning/roles/geerlingguy.php-versions/vars/Debian.yml +++ b/provisioning/roles/geerlingguy.php-versions/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