From 0746f69628c1cf1605dbcd0156c22fd5fb7b9bc1 Mon Sep 17 00:00:00 2001 From: Yosafat Marselino Date: Sat, 17 May 2025 10:03:38 -0400 Subject: [PATCH] Declare vars on playbook --- curl_execute.yaml | 4 ++++ test-scripts/install_k8s.sh | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/curl_execute.yaml b/curl_execute.yaml index 5fd8a19..8d5d25b 100644 --- a/curl_execute.yaml +++ b/curl_execute.yaml @@ -2,6 +2,10 @@ - name: Curl and execute scripts on target machine hosts: target_hosts become: yes # Use sudo if needed + vars: + script_params: + ip: "192.168.1.100" + prune: "false" tasks: - name: Convert params dictionary to command line arguments set_fact: diff --git a/test-scripts/install_k8s.sh b/test-scripts/install_k8s.sh index 6d2029e..41f8837 100644 --- a/test-scripts/install_k8s.sh +++ b/test-scripts/install_k8s.sh @@ -41,7 +41,7 @@ while [ $# -gt 0 ]; do shift 2 ;; -prune | --prune) - PRUNE=true + PRUNE="$2" shift 2 ;; *) @@ -95,7 +95,7 @@ check_existing_cluster() { if command_exists kubectl && kubectl cluster-info &>/dev/null; then echo "Found existing installation" echo "Proceed to clean em UP" - if [[ $PRUNE != true ]]; then + if [[ $PRUNE != "true" ]]; then echo "Kubernetes cluster removal skipped. Exiting script." exit 0 fi