* hydractl
* sync-tpc: way to ignore /var/cache/qemu and other files from syncing,
- perhaps a .sync-tpc-ignore.
-* hydra:
- * deploy: ansible support
+ perhaps a .sync-tpc-ignore at the destination.
#echo ' \/\/ \/ \/ \/ \/|__| \/ \/'
#echo ''
-# Deploy
+#
+# Deploy iterating over each node
+#
for node in $NODES; do
if [ -d "$node" ]; then
echo "Deploying to $node folder..."
fi
fi
done
+
+#
+# Deploy using ansible own iterator
+#
+
+# Command line arguments
+NODES="$*"
+
+# Build node list
+#if [ -z "$NODES" ]; then
+# #NODES="`BACKEND=ansible hydra $HYDRA nodes | xargs | sed -e "s/^/'~(/" -e "s/ /|/g" -e "s/$/)'/`"
+# NODES="all"
+#else
+if [ ! -z "$NODES" ]; then
+ # Check if first param is a node name, otherwise assume its a class
+ if [ -z "$2" ]; then
+ NODES="`BACKEND=ansible hydra $HYDRA nodes $1`"
+
+ if [ -z "$NODES" ]; then
+ NODES="`BACKEND=ansible hydra $HYDRA nodes $1'*'`"
+ fi
+
+ # It's a class
+ if [ ! -z "$NODES" ] && [ "`echo $NODES | wc -w`" != "1" ]; then
+ #NODES="`echo $NODES | xargs | sed -e "s/^/'~(/" -e "s/ /|/g" -e "s/$/)'/"`"
+ NODES="$*"
+ fi
+ fi
+fi
+
+hydra $HYDRA ansible-playbook site.yml --limit $NODES
CLASS="all"
fi
- hydra $HYDRA ansible $CLASS --list-hosts | grep -v "^ hosts (" | sed -e 's/^ //'
+ hydra $HYDRA ansible $CLASS --list-hosts 2> /dev/null | grep -v "^ hosts (" | sed -e 's/^ //'
}
# Load
# Command line arguments
CLASS="$1"
-# Validation
+# Dispatch
if ! [ -z "$PUPPET" ] && [ "$BACKEND" != "ansible" ]; then
hydra_nodes_puppet
elif [ -d "$HYDRA_FOLDER/ansible" ]; then