summaryrefslogtreecommitdiffstats
path: root/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/recipes/02-createDoxKeyspace.rb
blob: 5f740a890906e2d5a3504df09beba5a058a12501 (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
25
26
27
28
29
30
31
32
33
34
template "/tmp/create_dox_keyspace.sh" do
    source "create_dox_keyspace.sh.erb"
    sensitive true
    mode 0755
    variables({
      :cassandra_ip     => node['Nodes']['CS'].first,
      :cassandra_port   => node['cassandra'][:cassandra_port],
      :DC_NAME          => node['cassandra']['datacenter_name'],
      :cassandra_pwd    => node['cassandra'][:cassandra_password],
      :cassandra_usr    => node['cassandra'][:cassandra_user]
    })
end


remote_directory '/tmp/tools' do
    source 'tools'
    mode '0755'
    files_mode '0755'
    action :create
end

execute "onboard-db-schema-creation" do
    ignore_failure true
  command "chmod +x onboard-db-schema-creation.sh && sh -x /tmp/tools/build/scripts/onboard-db-schema-creation.sh"
  cwd "/tmp/tools/build/scripts"
  action :run
end

execute "create-DOX-schema" do
    ignore_failure true
  command "chmod +x /tmp/create_dox_keyspace.sh && /tmp/create_dox_keyspace.sh"
  cwd "/tmp"
  action :run
end