Alexis de Talhouƫt | a644558 | 2017-03-08 17:33:55 -0500 | [diff] [blame] | 1 | #!/bin/bash |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 2 | |
| 3 | cd /root/chef-solo |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 4 | echo "normal['HOST_IP'] = \"${HOST_IP}\"" >> /root/chef-solo/cookbooks/cassandra-actions/attributes/default.rb |
| 5 | |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 6 | export CHEFNAME=${ENVNAME} |
| 7 | |
| 8 | sed -i "s/HOSTIP/${HOST_IP}/g" /root/chef-solo/cookbooks/cassandra-actions/recipes/02-createCsUser.rb |
| 9 | sed -i "s/HOSTIP/${HOST_IP}/g" /root/chef-solo/cookbooks/cassandra-actions/recipes/03-createDoxKeyspace.rb |
| 10 | sed -i "s/HOSTIP/${HOST_IP}/g" /root/chef-solo/cookbooks/cassandra-actions/recipes/04-schemaCreation.rb |
| 11 | |
| 12 | chef-solo -c solo.rb -o recipe[cassandra-actions::01-configureCassandra] -E ${CHEFNAME} |
| 13 | rc=$? |
| 14 | |
| 15 | if [[ $rc != 0 ]]; then exit $rc; fi |
| 16 | echo "########### starting cassandra ###########" |
| 17 | # start cassandra |
| 18 | /docker-entrypoint.sh cassandra -f & |
| 19 | |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 20 | sleep 10 |
| 21 | |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 22 | chef-solo -c solo.rb -E ${CHEFNAME} |
| 23 | |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 24 | while true; do sleep 2; done |
| 25 | |