summaryrefslogtreecommitdiffstats
path: root/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/03-prepareProbeFile.rb
blob: 3d722021dae4dbe8746d2e67d15834f47a70efba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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 "/var/lib/ready-probe.sh" do
  source "ready-probe.sh.erb"
  sensitive true
  mode 0755
  variables({
     :cassandra_ip => application_host,
     :cassandra_pwd => ENV['CS_PASSWORD']
  })
end


bash "run_probe_script" do
   code <<-EOH
     /var/lib/ready-probe.sh
   EOH
end