From ee481cc7d49f08206d7c9c3ed212610449e47011 Mon Sep 17 00:00:00 2001 From: mbenabda Date: Thu, 20 Jun 2019 16:45:28 +0200 Subject: [PATCH] VTWO-14496 : allow running scripts on a subset of the nodes --- README.md | 4 ++-- scripts/node_names | 2 +- scripts/{run_script_on_all_nodes => run_script_on_nodes} | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename scripts/{run_script_on_all_nodes => run_script_on_nodes} (77%) diff --git a/README.md b/README.md index 8cffa98..6f069cf 100644 --- a/README.md +++ b/README.md @@ -16,10 +16,10 @@ vagrant up - setup a container runtime ```sh -./scripts/run_script_on_all_nodes install_container_runtime +./scripts/run_script_on_nodes install_container_runtime ``` - download kubernetes ```sh -./scripts/run_script_on_all_nodes download_node_binaries +./scripts/run_script_on_nodes download_node_binaries ``` \ No newline at end of file diff --git a/scripts/node_names b/scripts/node_names index 4426d41..be86bf4 100755 --- a/scripts/node_names +++ b/scripts/node_names @@ -1,3 +1,3 @@ #!/usr/bin/env bash -vagrant status --machine-readable | grep ,state, | cut -d, -f2 | sort | uniq \ No newline at end of file +vagrant status --machine-readable | grep ,state, | cut -d, -f2 | sort | uniq | grep "$1" \ No newline at end of file diff --git a/scripts/run_script_on_all_nodes b/scripts/run_script_on_nodes similarity index 77% rename from scripts/run_script_on_all_nodes rename to scripts/run_script_on_nodes index a62943f..02fe07e 100755 --- a/scripts/run_script_on_all_nodes +++ b/scripts/run_script_on_nodes @@ -1,7 +1,7 @@ #!/usr/bin/env bash SCRIPTS_DIR=$(dirname $0) SCRIPT_NAME=$1 -NODE_NAMES=$($SCRIPTS_DIR/node_names) +NODE_NAMES="$($SCRIPTS_DIR/node_names $2)" cat $SCRIPTS_DIR/$SCRIPT_NAME