forked from realityforge/chef-kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
/
apache.rb
30 lines (25 loc) · 791 Bytes
/
apache.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Encoding: utf-8
=begin
#<
Setup vhost for apache that rewrites to Kibana.
#>
=end
include_recipe 'apache2'
include_recipe 'apache2::mod_proxy'
include_recipe 'apache2::mod_proxy_http'
template "#{node['apache']['dir']}/htpasswd" do
variables(username: node['kibana']['apache']['basic_auth_username'],
password: node['kibana']['apache']['basic_auth_password'])
owner node['apache']['user']
group node['apache']['group']
mode 00644
end
template "#{node['apache']['dir']}/sites-available/kibana" do
source 'vhost.conf.erb' if node['kibana']['version'] =~ /^2/
source 'vhost3.conf.erb' if node['kibana']['version'] =~ /^3/
owner node['apache']['user']
group node['apache']['group']
mode 00644
notifies :restart, 'service[apache2]'
end
apache_site 'kibana'