Switch to dynamic ansible inventory

We don't need to install and use kargo cli anymore.
This commit is contained in:
Aleksandr Didenko
2016-07-08 17:08:09 +02:00
parent e89f4ac7ee
commit 8d3abdb489
4 changed files with 69 additions and 17 deletions

View File

@@ -1,6 +1,6 @@
#!/bin/bash
INVENTORY="/root/kargo/inventory/inventory.cfg"
INVENTORY="nodes_to_inv.py"
nodes=""
i=1
@@ -9,13 +9,6 @@ for nodeip in `cat nodes` ; do
nodes+=" node${i}[ansible_ssh_host=${nodeip},ip=${nodeip}]"
done
if [ -f "$INVENTORY" ] ; then
echo "$INVENTORY already exists, if you want to recreate, pls remove it and re-run this script"
else
echo "Preparing inventory..."
kargo prepare -y --nodes $nodes
fi
echo "Running deployment..."
#kargo deploy -y --ansible-opts="-e @custom.yaml"
ansible-playbook -i $INVENTORY /root/kargo/cluster.yml -e @custom.yaml