blob: b48eecd9b03b83eededa85901c9ca54d5fd9a635 [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,
Tal Gitelmanc4d387d2019-03-28 11:00:54 +020039 :cassandra_port => node['cassandra']['cassandra_port'],
Michael Lando50ffa6b2018-01-08 10:52:07 +020040 :rep_factor => 1,
Areli, Fuss (af732p)efa33262018-05-09 15:45:03 +030041 :DC_NAME => node['cassandra']['datacenter_name']+node.chef_environment,
Michael Lando50ffa6b2018-01-08 10:52:07 +020042 :titan_Path => "/tmp/sdctool/config/",
43 :socket_connect_timeout => node['cassandra']['socket_connect_timeout'],
44 :socket_read_timeout => node['cassandra']['socket_read_timeout'],
45 :cassandra_pwd => node['cassandra'][:cassandra_password],
46 :cassandra_usr => node['cassandra'][:cassandra_user]
Michael Lando451a3402017-02-19 10:28:42 +020047 })
48end
49
Michael Landoed64b5e2017-06-09 03:19:04 +030050
Michael Lando451a3402017-02-19 10:28:42 +020051template "/tmp/sdctool/config/elasticsearch.yml" do
Michael Landoed64b5e2017-06-09 03:19:04 +030052 sensitive true
Michael Lando451a3402017-02-19 10:28:42 +020053 source "elasticsearch.yml.erb"
54 mode 0755
55 variables({
Yuli Shlosberg0875ce02018-01-25 13:53:36 +020056 :elastic_ip => node['Nodes']['ES']
Michael Lando451a3402017-02-19 10:28:42 +020057 })
58end
59
Michael Landoed64b5e2017-06-09 03:19:04 +030060bash "excuting-schema-creation" do
61 code <<-EOH
62 cd /tmp
63 chmod +x /tmp/sdctool/scripts/schemaCreation.sh
64 /tmp/sdctool/scripts/schemaCreation.sh /tmp/sdctool/config
65 EOH
66end
Yuli Shlosberg0875ce02018-01-25 13:53:36 +020067
68bash "excuting-titanSchemaCreation.sh" do
69 code <<-EOH
70 chmod +x /tmp/sdctool/scripts/titanSchemaCreation.sh
71 /tmp/sdctool/scripts/titanSchemaCreation.sh /tmp/sdctool/config
72 EOH
73end