From 5f50517d8533542e3ef3fe98e993c0392e2bd936 Mon Sep 17 00:00:00 2001 From: Prakasa Date: Fri, 11 Oct 2024 08:54:21 +0700 Subject: [PATCH] fix: require user confirmation to delete other php version in Debian --- defaults/main.yml | 4 ++++ tasks/setup-Debian.yml | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) 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