Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #300 from scopenco/change_apache_tmpl
Browse files Browse the repository at this point in the history
Add cookbook for apache conf templates
  • Loading branch information
vkhatri authored Sep 4, 2017
2 parents 3cd6505 + f6e797a commit 6f6d416
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2077,6 +2077,12 @@ Above LWRP resource will apply `Dependency` to all `Host` objects for provided `

* `default['icinga2']['apache_modules']` (default: `calculated`): apache modules / apache2 cookbook recipe to enable

* `default['icinga2']['apache_conf_cookbook']` (default: `icinga2`): cookbook for apache templates

* `default['icinga2']['apache_classic_ui_template']` (default: `apache.vhost.icinga2_classic_ui.conf.#{node['platform_family']}.erb`): apache template for classic ui

* `default['icinga2']['apache_web2_template']` (default: `apache.vhost.icinga2_web2.erb`): apache template for icingaweb2


## Cookbook Icinga2 Constants Attributes

Expand Down
4 changes: 4 additions & 0 deletions attributes/server_apache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@
%w(centos redhat fedora) => { '>= 7.0' => %w(default mod_wsgi mod_php5 mod_cgi mod_ssl mod_rewrite),
'default' => %w(default mod_python mod_php5 mod_cgi mod_ssl mod_rewrite) }
)

default['icinga2']['apache_classic_ui_template'] = "apache.vhost.icinga2_classic_ui.conf.#{node['platform_family']}.erb"
default['icinga2']['apache_web2_template'] = 'apache.vhost.icinga2_web2.erb'
default['icinga2']['apache_conf_cookbook'] = 'icinga2'
4 changes: 3 additions & 1 deletion recipes/server_apache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,16 @@
source "apache.vhost.icinga2_classic_ui.conf.#{apache_conf_file}.erb"
owner node['apache']['user']
group node['apache']['group']
cookbook node['icinga2']['apache_conf_cookbook']
notifies platform?('windows') ? :restart : :reload, 'service[apache2]', :delayed
only_if { node['icinga2']['classic_ui']['enable'] }
end

template ::File.join(node['apache']['dir'], 'conf-available', 'icinga2-web2.conf') do
source 'apache.vhost.icinga2_web2.erb'
source node['icinga2']['apache_web2_template']
owner node['apache']['user']
group node['apache']['group']
cookbook node['icinga2']['apache_conf_cookbook']
notifies platform?('windows') ? :restart : :reload, 'service[apache2]', :delayed
variables(:web_root => node['icinga2']['web2']['web_root'],
:web_uri => node['icinga2']['web2']['web_uri'],
Expand Down

0 comments on commit 6f6d416

Please sign in to comment.