blob: 3c001dfbabae9b3255a11168df52fe0ba569f6ee [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 +03004mkdir -p /root/chef-solo/cookbooks/cassandra-actions/attributes
5echo "normal['version'] = \"${RELEASE}\"" > /root/chef-solo/cookbooks/cassandra-actions/attributes/default.rb
6echo "normal['HOST_IP'] = \"${HOST_IP}\"" >> /root/chef-solo/cookbooks/cassandra-actions/attributes/default.rb
7
Michael Lando451a3402017-02-19 10:28:42 +02008export CHEFNAME=${ENVNAME}
9
10sed -i "s/HOSTIP/${HOST_IP}/g" /root/chef-solo/cookbooks/cassandra-actions/recipes/02-createCsUser.rb
11sed -i "s/HOSTIP/${HOST_IP}/g" /root/chef-solo/cookbooks/cassandra-actions/recipes/03-createDoxKeyspace.rb
12sed -i "s/HOSTIP/${HOST_IP}/g" /root/chef-solo/cookbooks/cassandra-actions/recipes/04-schemaCreation.rb
13
14chef-solo -c solo.rb -o recipe[cassandra-actions::01-configureCassandra] -E ${CHEFNAME}
15rc=$?
16
17if [[ $rc != 0 ]]; then exit $rc; fi
18echo "########### starting cassandra ###########"
19# start cassandra
20/docker-entrypoint.sh cassandra -f &
21
Michael Landoed64b5e2017-06-09 03:19:04 +030022sleep 10
23
Michael Lando451a3402017-02-19 10:28:42 +020024chef-solo -c solo.rb -E ${CHEFNAME}
25
Michael Lando451a3402017-02-19 10:28:42 +020026while true; do sleep 2; done
27