diff options
Diffstat (limited to 'asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb')
-rw-r--r-- | asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb deleted file mode 100644 index 9fa3130542..0000000000 --- a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -CASSANDRA_IP=<%= @cassandra_ip %> -CASSANDRA_PORT=<%= @cassandra_port %> -CS_PASSWORD=<%= @cassandra_pwd %> -SDC_USER=<%= @sdc_usr %> -SDC_PASSWORD=<%= @sdc_pwd %> - - -pass_changed=99 -retry_num=1 -is_up=0 -while [ $is_up -eq 0 -a $retry_num -le 100 ]; do - - echo "exit" | cqlsh -u cassandra -p $CS_PASSWORD $CASSANDRA_IP $CASSANDRA_PORT - res1=$? - - if [ $res1 -eq 0 ]; then - echo "`date` --- cqlsh is able to connect." - is_up=1 - else - echo "`date` --- cqlsh is NOT able to connect yet. sleep 5" - sleep 5 - fi - retry_num=$((retry_num+1)) -done - -cassandra_user_exist=`echo "list users;" | cqlsh -u cassandra -p $CS_PASSWORD $CASSANDRA_IP $CASSANDRA_PORT | grep -c $SDC_USER` - if [ $cassandra_user_exist -eq 1 ] ; then - echo "cassandra user $SDC_USER already exist" - else - echo "Going to create $SDC_USER" - echo "create user $SDC_USER with password '$SDC_PASSWORD' nosuperuser;" | cqlsh -u cassandra -p $CS_PASSWORD $CASSANDRA_IP $CASSANDRA_PORT - fi
\ No newline at end of file |