blob: a62550eeaeea7cc2e4564503952612a4ddb5db91 [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
shrikantawachar2623c842019-05-20 12:11:54 +053015template "janusgraph.properties" do
Michael Landoed64b5e2017-06-09 03:19:04 +030016 sensitive true
shrikantawachar2623c842019-05-20 12:11:54 +053017 path "/tmp/sdctool/config/janusgraph.properties"
18 source "janusgraph.properties.erb"
Michael Landoed64b5e2017-06-09 03:19:04 +030019 mode "0755"
20 variables({
k.kedron004fb642019-07-09 13:02:08 +020021 :DC_NAME => node['cassandra']['datacenter_name'],
22 :cassandra_ip => node['Nodes']['CS'].first,
shrek20000594c412020-01-30 14:52:49 +020023 :cassandra_port_num => node['cassandra'][:cassandra_port],
24 :janus_connection_timeout => node['cassandra'][:janusgraph_connection_timeout],
k.kedron004fb642019-07-09 13:02:08 +020025 :cassandra_pwd => node['cassandra'][:cassandra_password],
26 :cassandra_usr => node['cassandra'][:cassandra_user],
k.kedron004fb642019-07-09 13:02:08 +020027 :replication_factor => node['cassandra']['replication_factor']
Michael Landoed64b5e2017-06-09 03:19:04 +030028 })
29end
30
31
Michael Lando451a3402017-02-19 10:28:42 +020032template "/tmp/sdctool/config/configuration.yaml" do
Michael Landoed64b5e2017-06-09 03:19:04 +030033 sensitive true
Michael Lando451a3402017-02-19 10:28:42 +020034 source "configuration.yaml.erb"
35 mode 0755
36 variables({
Yuli Shlosberg0875ce02018-01-25 13:53:36 +020037 :host_ip => node['Nodes']['BE'],
Michael Lando50ffa6b2018-01-08 10:52:07 +020038 :catalog_port => node['BE'][:http_port],
39 :ssl_port => node['BE'][:https_port],
Areli, Fuss (af732p)c033cdc2018-04-24 13:59:00 +030040 :cassandra_ip => node['Nodes']['CS'].first,
Tal Gitelmanc4d387d2019-03-28 11:00:54 +020041 :cassandra_port => node['cassandra']['cassandra_port'],
mahendrrf454e702019-04-18 10:39:30 +000042 :rep_factor => node['cassandra']['replication_factor'],
43 :DC_NAME => node['cassandra']['datacenter_name'],
shrikantawachar2623c842019-05-20 12:11:54 +053044 :janusgraph_Path => "/tmp/sdctool/config/",
Michael Lando50ffa6b2018-01-08 10:52:07 +020045 :socket_connect_timeout => node['cassandra']['socket_connect_timeout'],
46 :socket_read_timeout => node['cassandra']['socket_read_timeout'],
47 :cassandra_pwd => node['cassandra'][:cassandra_password],
48 :cassandra_usr => node['cassandra'][:cassandra_user]
Michael Lando451a3402017-02-19 10:28:42 +020049 })
50end
51
Michael Landoed64b5e2017-06-09 03:19:04 +030052
Michael Lando451a3402017-02-19 10:28:42 +020053
k.kedron004fb642019-07-09 13:02:08 +020054bash "executing-schema-creation" do
Michael Landoed64b5e2017-06-09 03:19:04 +030055 code <<-EOH
56 cd /tmp
57 chmod +x /tmp/sdctool/scripts/schemaCreation.sh
58 /tmp/sdctool/scripts/schemaCreation.sh /tmp/sdctool/config
59 EOH
60end
Yuli Shlosberg0875ce02018-01-25 13:53:36 +020061
k.kedron004fb642019-07-09 13:02:08 +020062bash "executing-janusGraphSchemaCreation.sh" do
Yuli Shlosberg0875ce02018-01-25 13:53:36 +020063 code <<-EOH
shrikantawachar2623c842019-05-20 12:11:54 +053064 chmod +x /tmp/sdctool/scripts/janusGraphSchemaCreation.sh
65 /tmp/sdctool/scripts/janusGraphSchemaCreation.sh /tmp/sdctool/config
Yuli Shlosberg0875ce02018-01-25 13:53:36 +020066 EOH
67end