From c3911172d911060184a10413106f436c3f78ecbf Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 31 May 2018 09:27:27 -0300 Subject: Deploy: possible localhost handling for ansible --- share/hydra/deploy | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'share') diff --git a/share/hydra/deploy b/share/hydra/deploy index ec4153f..9b8db2f 100755 --- a/share/hydra/deploy +++ b/share/hydra/deploy @@ -251,7 +251,7 @@ EOF done # -# Deploy using ansible own iterator +# Deploy using ansible's own iterator # if [ -e "$HYDRA_FOLDER/ansible/ansible.cfg" ]; then # Command line arguments @@ -264,7 +264,7 @@ if [ -e "$HYDRA_FOLDER/ansible/ansible.cfg" ]; then #else if [ ! -z "$NODES" ]; then # Check if first param is a node name, otherwise assume its a class - if [ -z "$2" ]; then + if [ -z "$2" ] && [ "$1" != "localhost" ]; then NODES="`BACKEND=ansible hydra $HYDRA nodes $1`" if [ -z "$NODES" ]; then @@ -276,7 +276,11 @@ if [ -e "$HYDRA_FOLDER/ansible/ansible.cfg" ]; then #NODES="`echo $NODES | xargs | sed -e "s/^/'~(/" -e "s/ /|/g" -e "s/$/)'/"`" NODES="$*" fi - fi + # This can be handled directly by the ansible hosts file + # http://ansible.pickle.io/post/86598332429/running-ansible-playbook-in-localhost + #elif [ "$NODES" == "localhost" ]; then + # NODES="`cat /etc/hostname`" + #fi else NODES="all" fi -- cgit v1.2.3