aboutsummaryrefslogtreecommitdiffstats
path: root/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/recipes/ES_1_setup_elasticsearch.rb
diff options
context:
space:
mode:
Diffstat (limited to 'sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/recipes/ES_1_setup_elasticsearch.rb')
-rw-r--r--sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/recipes/ES_1_setup_elasticsearch.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/recipes/ES_1_setup_elasticsearch.rb b/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/recipes/ES_1_setup_elasticsearch.rb
new file mode 100644
index 0000000000..854898c1b7
--- /dev/null
+++ b/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/recipes/ES_1_setup_elasticsearch.rb
@@ -0,0 +1,16 @@
+clusterName = node['elasticsearch'][:cluster_name]+node.chef_environment
+node_name = node[:hostname]
+
+template "/usr/share/elasticsearch/config/elasticsearch.yml" do
+ source "ES-elasticsearch.yml.erb"
+ owner "elasticsearch"
+ group "elasticsearch"
+ mode "0755"
+ variables({
+ :cluster_name => "#{clusterName}",
+ :node_name => node_name,
+ :ES_IP => node['Nodes']['ES'],
+ :num_of_shards => node['elasticsearch'][:num_of_shards],
+ :num_of_replicas => node['elasticsearch'][:num_of_replicas]
+ })
+end