summaryrefslogtreecommitdiffstats
path: root/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/02-changeCSpass.rb
diff options
context:
space:
mode:
Diffstat (limited to 'sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/02-changeCSpass.rb')
-rw-r--r--sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/02-changeCSpass.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/02-changeCSpass.rb b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/02-changeCSpass.rb
index 22ef07907d..7afb307401 100644
--- a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/02-changeCSpass.rb
+++ b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/02-changeCSpass.rb
@@ -1,9 +1,17 @@
+interface = node['interfaces']['application']
+application_host = ''
+node['network']['interfaces'][interface][:addresses].each do | addr , details |
+ if details['family'] == ('inet')
+ application_host = addr
+ end
+end
+
template "/tmp/change_cassandra_pass.sh" do
source "change_cassandra_pass.sh.erb"
sensitive true
mode 0755
variables({
- :cassandra_ip => node['Nodes']['CS'],
+ :cassandra_ip => application_host,
:cassandra_pwd => ENV['CS_PASSWORD']
})
end