blob: d2c7a8c0a85b3837fc0045a872ebf0f876a999e1 [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({
Areli, Fuss (af732p)efa33262018-05-09 15:45:03 +030021 :DC_NAME => node['cassandra']['datacenter_name']+node.chef_environment,
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],
25 :titan_connection_timeout => node['cassandra']['titan_connection_timeout']
Michael Landoed64b5e2017-06-09 03:19:04 +030026 })
27end
28
29
Michael Lando451a3402017-02-19 10:28:42 +020030template "/tmp/sdctool/config/configuration.yaml" do
Michael Landoed64b5e2017-06-09 03:19:04 +030031 sensitive true
Michael Lando451a3402017-02-19 10:28:42 +020032 source "configuration.yaml.erb"
33 mode 0755
34 variables({
Yuli Shlosberg0875ce02018-01-25 13:53:36 +020035 :host_ip => node['Nodes']['BE'],
Michael Lando50ffa6b2018-01-08 10:52:07 +020036 :catalog_port => node['BE'][:http_port],
37 :ssl_port => node['BE'][:https_port],
Areli, Fuss (af732p)c033cdc2018-04-24 13:59:00 +030038 :cassandra_ip => node['Nodes']['CS'].first,
Michael Lando50ffa6b2018-01-08 10:52:07 +020039 :rep_factor => 1,
Areli, Fuss (af732p)efa33262018-05-09 15:45:03 +030040 :DC_NAME => node['cassandra']['datacenter_name']+node.chef_environment,
Michael Lando50ffa6b2018-01-08 10:52:07 +020041 :titan_Path => "/tmp/sdctool/config/",
42 :socket_connect_timeout => node['cassandra']['socket_connect_timeout'],
43 :socket_read_timeout => node['cassandra']['socket_read_timeout'],
44 :cassandra_pwd => node['cassandra'][:cassandra_password],
45 :cassandra_usr => node['cassandra'][:cassandra_user]
Michael Lando451a3402017-02-19 10:28:42 +020046 })
47end
48
Michael Landoed64b5e2017-06-09 03:19:04 +030049
Michael Lando451a3402017-02-19 10:28:42 +020050template "/tmp/sdctool/config/elasticsearch.yml" do
Michael Landoed64b5e2017-06-09 03:19:04 +030051 sensitive true
Michael Lando451a3402017-02-19 10:28:42 +020052 source "elasticsearch.yml.erb"
53 mode 0755
54 variables({
Yuli Shlosberg0875ce02018-01-25 13:53:36 +020055 :elastic_ip => node['Nodes']['ES']
Michael Lando451a3402017-02-19 10:28:42 +020056 })
57end
58
Michael Landoed64b5e2017-06-09 03:19:04 +030059bash "excuting-schema-creation" do
60 code <<-EOH
61 cd /tmp
62 chmod +x /tmp/sdctool/scripts/schemaCreation.sh
63 /tmp/sdctool/scripts/schemaCreation.sh /tmp/sdctool/config
64 EOH
65end
Yuli Shlosberg0875ce02018-01-25 13:53:36 +020066
67bash "excuting-titanSchemaCreation.sh" do
68 code <<-EOH
69 chmod +x /tmp/sdctool/scripts/titanSchemaCreation.sh
70 /tmp/sdctool/scripts/titanSchemaCreation.sh /tmp/sdctool/config
71 EOH
72end