blob: 2f7cc3c53df7acb23fcce52afa1019180a6b4404 [file] [log] [blame]
Alexis de Talhouƫta6445582017-03-08 17:33:55 -05001#!/bin/bash
Michael Lando451a3402017-02-19 10:28:42 +02002
3cd /root/chef-solo
Michael Landoed64b5e2017-06-09 03:19:04 +03004echo "normal['HOST_IP'] = \"${HOST_IP}\"" >> /root/chef-solo/cookbooks/cassandra-actions/attributes/default.rb
5
Michael Lando451a3402017-02-19 10:28:42 +02006export CHEFNAME=${ENVNAME}
7
8sed -i "s/HOSTIP/${HOST_IP}/g" /root/chef-solo/cookbooks/cassandra-actions/recipes/02-createCsUser.rb
9sed -i "s/HOSTIP/${HOST_IP}/g" /root/chef-solo/cookbooks/cassandra-actions/recipes/03-createDoxKeyspace.rb
10sed -i "s/HOSTIP/${HOST_IP}/g" /root/chef-solo/cookbooks/cassandra-actions/recipes/04-schemaCreation.rb
11
12chef-solo -c solo.rb -o recipe[cassandra-actions::01-configureCassandra] -E ${CHEFNAME}
13rc=$?
14
15if [[ $rc != 0 ]]; then exit $rc; fi
16echo "########### starting cassandra ###########"
17# start cassandra
18/docker-entrypoint.sh cassandra -f &
19
Michael Landoed64b5e2017-06-09 03:19:04 +030020sleep 10
21
Michael Lando451a3402017-02-19 10:28:42 +020022chef-solo -c solo.rb -E ${CHEFNAME}
23
Michael Lando451a3402017-02-19 10:28:42 +020024while true; do sleep 2; done
25