diff --git a/defaults/main.yml b/defaults/main.yml index 2925129..bfaecb4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -4,3 +4,7 @@ php_version: '8.3' # For Debian OSes only. php_versions_install_recommends: false + +# Purge others version need user confirmation, default to false (no delete) +# if auto delete, causing break in the existing service which depend to other version +php_purge_other_version: false diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml index cfd093e..9c2d98e 100644 --- a/tasks/setup-Debian.yml +++ b/tasks/setup-Debian.yml @@ -49,6 +49,7 @@ purge: true force: true register: php_version_purge + when: php_purge_other_version - name: Also purge php-common package if any versions were just purged. apt: @@ -56,4 +57,4 @@ state: absent purge: true force: true - when: php_version_purge.changed | bool + when: php_version_purge.changed | bool and php_purge_other_version