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 | |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 15 | template "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) | efa3326 | 2018-05-09 15:45:03 +0300 | [diff] [blame] | 21 | :DC_NAME => node['cassandra']['datacenter_name']+node.chef_environment, |
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], |
| 25 | :titan_connection_timeout => node['cassandra']['titan_connection_timeout'] |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 26 | }) |
| 27 | end |
| 28 | |
| 29 | |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 30 | template "/tmp/sdctool/config/configuration.yaml" do |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 31 | sensitive true |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 32 | source "configuration.yaml.erb" |
| 33 | mode 0755 |
| 34 | variables({ |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 35 | :host_ip => node['Nodes']['BE'], |
Michael Lando | 50ffa6b | 2018-01-08 10:52:07 +0200 | [diff] [blame] | 36 | :catalog_port => node['BE'][:http_port], |
| 37 | :ssl_port => node['BE'][:https_port], |
Areli, Fuss (af732p) | c033cdc | 2018-04-24 13:59:00 +0300 | [diff] [blame] | 38 | :cassandra_ip => node['Nodes']['CS'].first, |
Michael Lando | 50ffa6b | 2018-01-08 10:52:07 +0200 | [diff] [blame] | 39 | :rep_factor => 1, |
Areli, Fuss (af732p) | efa3326 | 2018-05-09 15:45:03 +0300 | [diff] [blame] | 40 | :DC_NAME => node['cassandra']['datacenter_name']+node.chef_environment, |
Michael Lando | 50ffa6b | 2018-01-08 10:52:07 +0200 | [diff] [blame] | 41 | :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 Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 46 | }) |
| 47 | end |
| 48 | |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 49 | |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 50 | template "/tmp/sdctool/config/elasticsearch.yml" do |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 51 | sensitive true |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 52 | source "elasticsearch.yml.erb" |
| 53 | mode 0755 |
| 54 | variables({ |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 55 | :elastic_ip => node['Nodes']['ES'] |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 56 | }) |
| 57 | end |
| 58 | |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 59 | bash "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 |
| 65 | end |
Yuli Shlosberg | 0875ce0 | 2018-01-25 13:53:36 +0200 | [diff] [blame] | 66 | |
| 67 | bash "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 |
| 72 | end |