From 796642d7e0526246538b94b02907e43125695f54 Mon Sep 17 00:00:00 2001 From: Brandon Sherman Date: Mon, 13 Apr 2026 16:58:01 -0700 Subject: [PATCH] fix: use sudo -n detection for all distros instead of Debian hardcode Debian systems were unconditionally set to use --ask-become-pass, added to handle Debian 13's stricter default sudo configuration. This breaks Debian-based systems with passwordless sudo (e.g. DietPi), causing the installer to hang waiting for interactive input. The sudo -n true check already used for non-Debian systems handles both cases correctly: - Default Debian 13 (sudo requires password): exits 1 -> --ask-become-pass - Passwordless sudo (e.g. DietPi): exits 0 -> --become Remove the Debian special-case and apply the same detection universally. --- install.sh | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/install.sh b/install.sh index 3de29c08..29ea0005 100755 --- a/install.sh +++ b/install.sh @@ -251,23 +251,17 @@ if [ ! -f installer/install/tpot.yml ] && [ ! -f tpot.yml ]; fi # Check type of sudo access -if [ "$myANSIBLE_TAG" = "Debian" ]; - # Debian 13 - sudo seems to apply stricter settings, we now ask for the become password +sudo -n true > /dev/null 2>&1 +if [ $? -eq 1 ]; then - myANSIBLE_BECOME_OPTION="--become --ask-become-pass" + myANSIBLE_BECOME_OPTION="--ask-become-pass" + echo "### ‘sudo’ not acquired, setting ansible become option to ${myANSIBLE_BECOME_OPTION}." + echo "### Ansible will ask for the ‘BECOME password’ which is typically the password you ‘sudo’ with." + echo else - sudo -n true > /dev/null 2>&1 - if [ $? -eq 1 ]; - then - myANSIBLE_BECOME_OPTION="--ask-become-pass" - echo "### ‘sudo‘ not acquired, setting ansible become option to ${myANSIBLE_BECOME_OPTION}." - echo "### Ansible will ask for the ‘BECOME password‘ which is typically the password you ’sudo’ with." - echo - else - myANSIBLE_BECOME_OPTION="--become" - echo "### ‘sudo‘ acquired, setting ansible become option to ${myANSIBLE_BECOME_OPTION}." - echo - fi + myANSIBLE_BECOME_OPTION="--become" + echo "### ‘sudo’ acquired, setting ansible become option to ${myANSIBLE_BECOME_OPTION}." + echo fi # Run Ansible Playbook