Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 1 | cookbook_file "/tmp/sdctool.tar" do |
| 2 | source "sdctool.tar" |
| 3 | mode 0755 |
| 4 | end |
| 5 | |
| 6 | ## extract sdctool.tar |
| 7 | bash "install tar" do |
| 8 | cwd "/tmp" |
| 9 | code <<-EOH |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 10 | /bin/tar xf /tmp/sdctool.tar -C /tmp |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 11 | EOH |
| 12 | end |
| 13 | |
| 14 | |
shrikantawachar | 2623c84 | 2019-05-20 12:11:54 +0530 | [diff] [blame] | 15 | template "janusgraph.properties" do |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 16 | sensitive true |
shrikantawachar | 2623c84 | 2019-05-20 12:11:54 +0530 | [diff] [blame] | 17 | path "/tmp/sdctool/config/janusgraph.properties" |
| 18 | source "janusgraph.properties.erb" |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 19 | mode "0755" |
| 20 | variables({ |
mahendrr | f454e70 | 2019-04-18 10:39:30 +0000 | [diff] [blame] | 21 | :DC_NAME => node['cassandra']['datacenter_name'], |
Areli, Fuss (af732p) | c033cdc | 2018-04-24 13:59:00 +0300 | [diff] [blame] | 22 | :cassandra_ip => node['Nodes']['CS'].first, |
Michael Lando | 50ffa6b | 2018-01-08 10:52:07 +0200 | [diff] [blame] | 23 | :cassandra_pwd => node['cassandra'][:cassandra_password], |
| 24 | :cassandra_usr => node['cassandra'][:cassandra_user], |
shrikantawachar | 2623c84 | 2019-05-20 12:11:54 +0530 | [diff] [blame] | 25 | :janusgraph_connection_timeout => node['cassandra']['janusgraph_connection_timeout'], |
mahendrr | f454e70 | 2019-04-18 10:39:30 +0000 | [diff] [blame] | 26 | :replication_factor => node['cassandra']['replication_factor'] |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 27 | }) |
| 28 | end |
| 29 | |
| 30 | |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 31 | template "/tmp/sdctool/config/configuration.yaml" do |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 32 | sensitive true |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 33 | source "configuration.yaml.erb" |
| 34 | mode 0755 |
| 35 | variables({ |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 36 | :host_ip => node['Nodes']['BE'], |
Michael Lando | 50ffa6b | 2018-01-08 10:52:07 +0200 | [diff] [blame] | 37 | :catalog_port => node['BE'][:http_port], |
| 38 | :ssl_port => node['BE'][:https_port], |
Areli, Fuss (af732p) | c033cdc | 2018-04-24 13:59:00 +0300 | [diff] [blame] | 39 | :cassandra_ip => node['Nodes']['CS'].first, |
Tal Gitelman | c4d387d | 2019-03-28 11:00:54 +0200 | [diff] [blame] | 40 | :cassandra_port => node['cassandra']['cassandra_port'], |
mahendrr | f454e70 | 2019-04-18 10:39:30 +0000 | [diff] [blame] | 41 | :rep_factor => node['cassandra']['replication_factor'], |
| 42 | :DC_NAME => node['cassandra']['datacenter_name'], |
shrikantawachar | 2623c84 | 2019-05-20 12:11:54 +0530 | [diff] [blame] | 43 | :janusgraph_Path => "/tmp/sdctool/config/", |
Michael Lando | 50ffa6b | 2018-01-08 10:52:07 +0200 | [diff] [blame] | 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 Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 48 | }) |
| 49 | end |
| 50 | |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 51 | |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 52 | template "/tmp/sdctool/config/elasticsearch.yml" do |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 53 | sensitive true |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 54 | source "elasticsearch.yml.erb" |
| 55 | mode 0755 |
| 56 | variables({ |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 57 | :elastic_ip => node['Nodes']['ES'] |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 58 | }) |
| 59 | end |
| 60 | |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 61 | bash "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 |
| 67 | end |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 68 | |
shrikantawachar | 2623c84 | 2019-05-20 12:11:54 +0530 | [diff] [blame] | 69 | bash "excuting-janusGraphSchemaCreation.sh" do |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 70 | code <<-EOH |
shrikantawachar | 2623c84 | 2019-05-20 12:11:54 +0530 | [diff] [blame] | 71 | chmod +x /tmp/sdctool/scripts/janusGraphSchemaCreation.sh |
| 72 | /tmp/sdctool/scripts/janusGraphSchemaCreation.sh /tmp/sdctool/config |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 73 | EOH |
| 74 | end |