cookbook-zabbix/recipes/server_nginx.rb

33 lines
878 B
Ruby
Raw Normal View History

#
# Cookbook Name:: zabbix
# Recipe:: server_nginx
#
# Copyright 2017, Linux-Help.org
# Authors:
# Eric Renfro <psi-jack@linux-help.org>
#
#########################
# Setup and Install nginx
include_recipe 'chef_nginx'
nginx_site "zabbix" do
tname = node['zabbix']['php']['use_fpm'] ? "zabbix-fpm" : "zabbix-fcgi"
template %W{
nginx/#{node['platform']}/#{node['platform_version'].to_i}/#{tname}.conf.erb
nginx/#{node['platform']}/#{tname}.conf.erb
nginx/#{node['platform_family']}/#{node['platform_version'].to_i}/#{tname}.conf.erb
nginx/#{node['platform_family']}/#{tname}.conf.erb
nginx/default/#{tname}.conf.erb
nginx/#{tname}.conf.erb
}
variables({
:params => {
:server_port => node['nginx']['port'],
:server_name => "#{node['fqdn']}, zabbix.#{node['domain']}",
:docroot => '/usr/share/zabbix',
}
})
end