Skip to content
This repository has been archived by the owner on Mar 22, 2018. It is now read-only.

Commit

Permalink
tools: Added etcd_init.sh (#18)
Browse files Browse the repository at this point in the history
* tools: Added etcd_init.sh

Created the tools directory to house non-required yet helpful tools we may want to provide along with the service code. etcd_init.sh is the first tool added which initializes the Commissaire etcd keyspace.

* fixup! tools: Added etcd_init.sh

* fixup! tools: Added etcd_init.sh
  • Loading branch information
ashcrow authored and mbarnes committed Oct 17, 2016
1 parent 98a9700 commit 52da60f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tools/etcd_init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
#
# Creates the expected etcd directories for Commissaire

set -euo pipefail

echo "+ Creating Commissaire keyspaces..."
for x in clusters cluster hosts networks status; do
etcd_path="/commissaire/"$x
echo "++ Creating $etcd_path"
etcdctl mkdir $etcd_path || true
done

echo "+ Creating default network configuration..."
DEFAULT_NETWORK_JSON=`python -c "from commissaire.constants import DEFAULT_CLUSTER_NETWORK_JSON; print(str(DEFAULT_CLUSTER_NETWORK_JSON).replace('\'', '\"'))"`
etcdctl set /commissaire/networks/default "$DEFAULT_NETWORK_JSON"


echo "+ Commissaire etcd namesapce now looks like the following:"
etcdctl ls --recursive /commissaire/

0 comments on commit 52da60f

Please sign in to comment.