- dhcpd
- dmca
- donate
+ - elasticsearch
- exim
- fail2ban
- forum
- hardware
- hot
- incron
+ - kibana
- letsencrypt
+ - logstash
+ - logstash-forwarder
- mailman
- memcached
- munin
- name: donate
run_list:
- recipe[donate::default]
+ - name: elasticsearch
+ run_list:
+ - recipe[elasticsearch::default]
- name: exim
run_list:
- recipe[exim::default]
- name: incron
run_list:
- recipe[incron::default]
+ - name: kibana
+ run_list:
+ - recipe[kibana::default]
- name: letsencrypt
run_list:
- recipe[letsencrypt::default]
apt:
sources:
- openstreetmap
+ - name: logstash
+ run_list:
+ - recipe[logstash::default]
+ - name: logstash-forwarder
+ run_list:
+ - recipe[logstash::forwarder]
+ attributes:
+ logstash:
+ forwarder:
+ filebeat.prospectors:
+ - input_type: log
+ paths:
+ - /var/log/apache2/access.log
+ type: apache
- name: mailman
run_list:
- recipe[mailman::default]
-default[:elasticsearch][:version] = "1.7"
+default[:elasticsearch][:version] = "6.x"
+default[:elasticsearch][:cluster][:name] = "default"
default[:elasticsearch][:cluster][:routing][:allocation][:disk][:watermark][:low] = "85%"
default[:elasticsearch][:cluster][:routing][:allocation][:disk][:watermark][:high] = "90%"
default[:elasticsearch][:cluster][:routing][:allocation][:disk][:watermark][:flood_stage] = "95%"
version "1.0.0"
supports "ubuntu"
+depends "apt"
# limitations under the License.
#
-package %w[
- default-jre-headless
- elasticsearch
-]
+include_recipe "apt"
+
+package "default-jre-headless"
+package "elasticsearch"
template "/etc/elasticsearch/elasticsearch.yml" do
source "elasticsearch.yml.erb"
default[:kibana][:version] = "4.1.1"
default[:kibana][:sites] = {}
+
+default[:accounts][:users][:kibana][:status] = :role
version "1.0.0"
supports "ubuntu"
+depends "accounts"
depends "apache"
depends "systemd"
require "yaml"
+include_recipe "accounts"
include_recipe "apache"
apache_module "proxy_http"
version = node[:kibana][:version]
remote_file "#{Chef::Config[:file_cache_path]}/kibana-#{version}.tar.gz" do
- source "https://download.elastic.co/kibana/kibana/kibana-4.1.1-linux-x64.tar.gz"
+ source "https://download.elastic.co/kibana/kibana/kibana-#{version}-linux-x64.tar.gz"
not_if { ::File.exist?("/opt/kibana-#{version}/bin/kibana") }
end
default[:logstash][:forwarder]["output.logstash"]["ssl.certificate_authorities"] = "/etc/filebeat/filebeat.crt"
default[:logstash][:forwarder]["output.logstash"]["ssl.verification_mode"] = "none"
default[:logstash][:forwarder]["filebeat.prospectors"] = []
+
+default[:elasticsearch][:cluster][:name] = "logstash"
version "1.0.0"
supports "ubuntu"
+depends "apt"
+depends "elasticsearch"
depends "networking"
# limitations under the License.
#
+include_recipe "elasticsearch"
include_recipe "networking"
keys = data_bag_item("logstash", "keys")
user "root"
group "root"
mode 0o644
- notifies :reload, "service[logstash]"
+ notifies :start, "service[logstash]"
end
file "/etc/logrotate.d/logstash" do
service "logstash" do
action [:enable, :start]
- supports :status => true, :restart => true, :reload => true
end
template "/etc/cron.daily/expire-logstash" do
require "yaml"
+include_recipe "apt"
+
package "filebeat"
cookbook_file "/etc/filebeat/filebeat.crt" do
name "kibana"
description "Role applied to all kibana servers"
-default_attributes(
- :accounts => {
- :users => {
- :kibana => { :status => :role }
- }
- }
-)
-
run_list(
"recipe[kibana]"
)
description "Role applied to all logstash servers"
default_attributes(
- :elasticsearch => {
- :cluster => {
- :name => "logstash"
- },
- :version => "6.x"
- },
:kibana => {
:sites => {
:logstash => {
--- /dev/null
+{
+ "id": "kibana",
+ "uid": "521",
+ "comment": "Kibana",
+ "manage_home": false
+}
--- /dev/null
+{
+ "id": "keys",
+ "lumberjack": [
+ "-----BEGIN PRIVATE KEY-----",
+ "-----END PRIVATE KEY-----"
+ ],
+ "beats": [
+ "-----BEGIN PRIVATE KEY-----",
+ "-----END PRIVATE KEY-----"
+ ]
+}
--- /dev/null
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("elasticsearch") do
+ it { should be_installed }
+end
+
+describe service("elasticsearch") do
+ it { should be_enabled }
+ it { should be_running }
+end
+
+# describe port(9200) do
+# it { should be_listening.with("tcp") }
+# end
--- /dev/null
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("apache2") do
+ it { should be_installed }
+end
+
+describe service("apache2") do
+ it { should be_enabled }
+ it { should be_running }
+end
+
+describe port(80) do
+ it { should be_listening.with("tcp") }
+end
+
+describe port(443) do
+ it { should be_listening.with("tcp") }
+end
--- /dev/null
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("filebeat") do
+ it { should be_installed }
+end
+
+describe service("filebeat") do
+ it { should be_enabled }
+ it { should be_running }
+end
--- /dev/null
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("elasticsearch") do
+ it { should be_installed }
+end
+
+describe service("elasticsearch") do
+ it { should be_enabled }
+ it { should be_running }
+end
+
+# describe port(9200) do
+# it { should be_listening.with("tcp") }
+# end
--- /dev/null
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("logstash") do
+ it { should be_installed }
+end
+
+describe service("logstash") do
+ it { should be_enabled }
+ it { should be_running }
+end
+
+# describe port(5044) do
+# it { should be_listening.with("tcp") }
+# end