Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Commit

Permalink
Updated kibana recipe and template.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose M committed May 28, 2019
1 parent 227d97c commit 5db4bda
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
15 changes: 11 additions & 4 deletions cookbooks/wazuh_elastic/recipes/kibana.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
owner 'root'
group 'root'
variables({
:kibana_port_line => "server.port: #{node['wazuh-elastic']['kibana_port']}",
:kibana_host_line => "server.host: #{node['wazuh-elastic']['kibana_host']}",
:kibana_elasticsearch_server_line => "elasticsearch.hosts: ['#{node['wazuh-elastic']['kibana_elasticsearch_server']}']"
kibana_server_port: "server.port: #{node['wazuh-elastic']['kibana_server_port']}",
kibana_server_host: "server.host: #{node['wazuh-elastic']['kibana_server_host']}",
kibana_elasticsearch_server_host: "elasticsearch.hosts: ['#{node['wazuh-elastic']['kibana_elasticsearch_hosts']}']"
})
mode 0755
notifies :restart, "service[kibana]", :immediately
Expand All @@ -36,7 +36,7 @@

bash 'Waiting for elasticsearch curl response...' do
code <<-EOH
until (curl -XGET http://localhost:9200); do
until (curl -XGET http://#{node['wazuh-elastic']['elasticsearch_ip']}:#{node['wazuh-elastic']['elasticsearch_port']}); do
printf 'Waiting for elasticsearch....'
sleep 5
done
Expand All @@ -51,3 +51,10 @@
notifies :restart, "service[kibana]", :immediately
end

bash 'Verify Kibana folders owner' do
code <<-EOF
chown -R kibana:kibana /usr/share/kibana/optimize
chown -R kibana:kibana /usr/share/kibana/plugins
EOF
notifies :restart, "service[kibana]", :immediately
end
9 changes: 6 additions & 3 deletions cookbooks/wazuh_elastic/templates/default/kibana.yml.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# The default roles file is empty as the preferred method of defining roles is
# through the API/UI. File based roles are useful in error scenarios when the
# API based roles may not be available.
# Kibana is served by a back end server. This setting specifies the port to use.
<%=@kibana_port_line %>
<%= @kibana_server_port %>

# Specifies the address to which the Kibana server will bind. IP addresses and host names are both valid values.
# The default is 'localhost', which usually means remote machines will not be able to connect.
# To allow connections from remote users, set this parameter to a non-loopback address.
<%= @kibana_host_line %>
<%= @kibana_server_host %>

# Enables you to specify a path to mount Kibana at if you are running behind a proxy.
# Use the `server.rewriteBasePath` setting to tell Kibana if it should remove the basePath
Expand All @@ -25,7 +28,7 @@
#server.name: "your-hostname"

# The URLs of the Elasticsearch instances to use for all your queries.
<%= @kibana_elasticsearch_server_line %>
<%= @kibana_elasticsearch_server_host %>

# When this setting's value is true Kibana uses the hostname specified in the server.host
# setting. When the value of this setting is false, Kibana uses the hostname of the host
Expand Down

0 comments on commit 5db4bda

Please sign in to comment.