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({ |
| 21 | :DC_NAME => node['cassandra'][:cluster_name]+node.chef_environment |
| 22 | }) |
| 23 | end |
| 24 | |
| 25 | |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 26 | template "/tmp/sdctool/config/configuration.yaml" do |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 27 | sensitive true |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 28 | source "configuration.yaml.erb" |
| 29 | mode 0755 |
| 30 | variables({ |
| 31 | :host_ip => node['HOST_IP'], |
| 32 | :catalog_port => node['BE'][:http_port], |
| 33 | :ssl_port => node['BE'][:https_port], |
| 34 | :cassandra_ip => node['Nodes']['CS'], |
| 35 | :rep_factor => 1, |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 36 | :DC_NAME => node['cassandra'][:cluster_name]+node.chef_environment, |
| 37 | :titan_Path => "/tmp/sdctool/config/" |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 38 | }) |
| 39 | end |
| 40 | |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 41 | |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 42 | template "/tmp/sdctool/config/elasticsearch.yml" do |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 43 | sensitive true |
Michael Lando | 451a340 | 2017-02-19 10:28:42 +0200 | [diff] [blame] | 44 | source "elasticsearch.yml.erb" |
| 45 | mode 0755 |
| 46 | variables({ |
| 47 | :elastic_ip => "HOSTIP" |
| 48 | }) |
| 49 | end |
| 50 | |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 51 | |
| 52 | bash "excuting-schema-creation" do |
| 53 | code <<-EOH |
| 54 | cd /tmp |
| 55 | chmod +x /tmp/sdctool/scripts/schemaCreation.sh |
| 56 | /tmp/sdctool/scripts/schemaCreation.sh /tmp/sdctool/config |
| 57 | EOH |
| 58 | end |