Declare vars on playbook
This commit is contained in:
parent
6076e31518
commit
0746f69628
@ -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:
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user