blob: fbfcb2ecea2dc5ec217a42171a452c9ed7da8682 [file] [log] [blame]
Michael Lando451a3402017-02-19 10:28:42 +02001cookbook_file "/tmp/sdctool.tar" do
2 source "sdctool.tar"
3 mode 0755
4end
5
6## extract sdctool.tar
7bash "install tar" do
8 cwd "/tmp"
9 code <<-EOH
Michael Landoed64b5e2017-06-09 03:19:04 +030010 /bin/tar xf /tmp/sdctool.tar -C /tmp
Michael Lando451a3402017-02-19 10:28:42 +020011 EOH
12end
13
14
Michael Landoed64b5e2017-06-09 03:19:04 +030015template "titan.properties" do
16 sensitive true
17 path "/tmp/sdctool/config/titan.properties"
18 source "titan.properties.erb"
19 mode "0755"
20 variables({
mahendrrf454e702019-04-18 10:39:30 +000021 :DC_NAME => node['cassandra']['datacenter_name'],
Areli, Fuss (af732p)c033cdc2018-04-24 13:59:00 +030022 :cassandra_ip => node['Nodes']['CS'].first,
Michael Lando50ffa6b2018-01-08 10:52:07 +020023 :cassandra_pwd => node['cassandra'][:cassandra_password],
24 :cassandra_usr => node['cassandra'][:cassandra_user],
mahendrrf454e702019-04-18 10:39:30 +000025 :titan_connection_timeout => node['cassandra']['titan_connection_timeout'],
26 :replication_factor => node['cassandra']['replication_factor']
Michael Landoed64b5e2017-06-09 03:19:04 +030027 })
28end
29
30
Michael Lando451a3402017-02-19 10:28:42 +020031template "/tmp/sdctool/config/configuration.yaml" do
Michael Landoed64b5e2017-06-09 03:19:04 +030032 sensitive true
Michael Lando451a3402017-02-19 10:28:42 +020033 source "configuration.yaml.erb"
34 mode 0755
35 variables({
Yuli Shlosberg0875ce02018-01-25 13:53:36 +020036 :host_ip => node['Nodes']['BE'],
Michael Lando50ffa6b2018-01-08 10:52:07 +020037 :catalog_port => node['BE'][:http_port],
38 :ssl_port => node['BE'][:https_port],
Areli, Fuss (af732p)c033cdc2018-04-24 13:59:00 +030039 :cassandra_ip => node['Nodes']['CS'].first,
Tal Gitelmanc4d387d2019-03-28 11:00:54 +020040 :cassandra_port => node['cassandra']['cassandra_port'],
mahendrrf454e702019-04-18 10:39:30 +000041 :rep_factor => node['cassandra']['replication_factor'],
42 :DC_NAME => node['cassandra']['datacenter_name'],
Michael Lando50ffa6b2018-01-08 10:52:07 +020043 :titan_Path => "/tmp/sdctool/config/",
44 :socket_connect_timeout => node['cassandra']['socket_connect_timeout'],
45 :socket_read_timeout => node['cassandra']['socket_read_timeout'],
46 :cassandra_pwd => node['cassandra'][:cassandra_password],
47 :cassandra_usr => node['cassandra'][:cassandra_user]
Michael Lando451a3402017-02-19 10:28:42 +020048 })
49end
50
Michael Landoed64b5e2017-06-09 03:19:04 +030051
Michael Lando451a3402017-02-19 10:28:42 +020052template "/tmp/sdctool/config/elasticsearch.yml" do
Michael Landoed64b5e2017-06-09 03:19:04 +030053 sensitive true
Michael Lando451a3402017-02-19 10:28:42 +020054 source "elasticsearch.yml.erb"
55 mode 0755
56 variables({
Yuli Shlosberg0875ce02018-01-25 13:53:36 +020057 :elastic_ip => node['Nodes']['ES']
Michael Lando451a3402017-02-19 10:28:42 +020058 })
59end
60
Michael Landoed64b5e2017-06-09 03:19:04 +030061bash "excuting-schema-creation" do
62 code <<-EOH
63 cd /tmp
64 chmod +x /tmp/sdctool/scripts/schemaCreation.sh
65 /tmp/sdctool/scripts/schemaCreation.sh /tmp/sdctool/config
66 EOH
67end
Yuli Shlosberg0875ce02018-01-25 13:53:36 +020068
69bash "excuting-titanSchemaCreation.sh" do
70 code <<-EOH
71 chmod +x /tmp/sdctool/scripts/titanSchemaCreation.sh
72 /tmp/sdctool/scripts/titanSchemaCreation.sh /tmp/sdctool/config
73 EOH
74end