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
|
- name: Curl and execute scripts on target machine
|
||||||
hosts: target_hosts
|
hosts: target_hosts
|
||||||
become: yes # Use sudo if needed
|
become: yes # Use sudo if needed
|
||||||
|
vars:
|
||||||
|
script_params:
|
||||||
|
ip: "192.168.1.100"
|
||||||
|
prune: "false"
|
||||||
tasks:
|
tasks:
|
||||||
- name: Convert params dictionary to command line arguments
|
- name: Convert params dictionary to command line arguments
|
||||||
set_fact:
|
set_fact:
|
||||||
|
@ -41,7 +41,7 @@ while [ $# -gt 0 ]; do
|
|||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
-prune | --prune)
|
-prune | --prune)
|
||||||
PRUNE=true
|
PRUNE="$2"
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@ -95,7 +95,7 @@ check_existing_cluster() {
|
|||||||
if command_exists kubectl && kubectl cluster-info &>/dev/null; then
|
if command_exists kubectl && kubectl cluster-info &>/dev/null; then
|
||||||
echo "Found existing installation"
|
echo "Found existing installation"
|
||||||
echo "Proceed to clean em UP"
|
echo "Proceed to clean em UP"
|
||||||
if [[ $PRUNE != true ]]; then
|
if [[ $PRUNE != "true" ]]; then
|
||||||
echo "Kubernetes cluster removal skipped. Exiting script."
|
echo "Kubernetes cluster removal skipped. Exiting script."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user