Update more cookbooks
This commit is contained in:
@@ -2,6 +2,21 @@
|
||||
|
||||
This file is used to list changes made in each version of the nginx cookbook.
|
||||
|
||||
## 6.1.1 (2017-06-08)
|
||||
|
||||
- Use multipackage installs in the pagespeed recipe to speed things up
|
||||
- Several fixes for Amazon Linux on Chef 13+
|
||||
|
||||
## 6.1.0 (2017-06-07)
|
||||
|
||||
- Add attributes for setting the repository URLs
|
||||
- Fix support for Amazon Linux repos on Chef 13+
|
||||
|
||||
|
||||
## 6.0.3 (2017-06-05)
|
||||
|
||||
- Correctly compare nginx versions with multiple digits so 1.10 is properly recognized as coming after 1.2.
|
||||
|
||||
## 6.0.2 (2017-04-27)
|
||||
|
||||
- Resolve name conflicts in the resource
|
||||
|
||||
@@ -26,11 +26,11 @@ The following cookbooks are direct dependencies because they're used for common
|
||||
|
||||
The following platforms are supported and tested with Test Kitchen:
|
||||
|
||||
- Ubuntu 12.04+
|
||||
- CentOS 5+
|
||||
- Ubuntu 14.04+
|
||||
- CentOS 6+
|
||||
- Debian 7+
|
||||
- openSUSE 13.2+
|
||||
- FreeBSD 9+
|
||||
- openSUSE
|
||||
- FreeBSD
|
||||
|
||||
Other Debian and RHEL family distributions are assumed to work.
|
||||
|
||||
@@ -119,14 +119,6 @@ Generally used attributes. Some have platform specific values. See `attributes/d
|
||||
|
||||
- `node['nginx']['extra_configs']` - a Hash of key/values to nginx configuration.
|
||||
|
||||
### chef_nginx::echo
|
||||
|
||||
These attributes are used in the `chef_nginx::http_echo_module` recipe.
|
||||
|
||||
- `node['nginx']['echo']['version']` - The version of `http_echo` you want (default: 0.59)
|
||||
- `node['nginx']['echo']['url']` - URL for the tarball.
|
||||
- `node['nginx']['echo']['checksum']` - Checksum of the tarball.
|
||||
|
||||
### chef_nginx::devel
|
||||
|
||||
These attributes are used in the `chef_nginx::ngx_devel_module` recipe.
|
||||
@@ -135,6 +127,14 @@ These attributes are used in the `chef_nginx::ngx_devel_module` recipe.
|
||||
- `node['nginx']['devel']['url']` - The URL of the nginx devel module tar.gz file
|
||||
- `node['nginx']['devel']['checksum']` - The checksum of the nginx devel module tar.gz file
|
||||
|
||||
### chef_nginx::echo
|
||||
|
||||
These attributes are used in the `chef_nginx::http_echo_module` recipe.
|
||||
|
||||
- `node['nginx']['echo']['version']` - The version of `http_echo` you want (default: 0.59)
|
||||
- `node['nginx']['echo']['url']` - URL for the tarball.
|
||||
- `node['nginx']['echo']['checksum']` - Checksum of the tarball.
|
||||
|
||||
### chef_nginx::geoip
|
||||
|
||||
These attributes are used in the `chef_nginx::http_geoip_module` recipe. Please note that the `country_dat_checksum` and `city_dat_checksum` are based on downloads from a datacenter in Fremont, CA, USA. You really should override these with checksums for the geo tarballs from your node location.
|
||||
@@ -159,6 +159,13 @@ From: <http://nginx.org/en/docs/http/ngx_http_realip_module.html>
|
||||
- `node['nginx']['realip']['addresses']` - Addresses to use for the `http_realip` configuration.
|
||||
- `node['nginx']['realip']['real_ip_recursive']` - If recursive search is enabled, the original client address that matches one of the trusted addresses is replaced by the last non-trusted address sent in the request header field. Can be on "on" or "off" (default).
|
||||
|
||||
### chef_nginx::openssl_source
|
||||
|
||||
These attributes are used in the `chef_nginx::openssl_source` recipe.
|
||||
|
||||
- `node['nginx']['openssl_source']['version']` - The version of OpenSSL you want to download and use (default: 1.0.1t)
|
||||
- `node['nginx']['openssl_source']['url']` - The url for the OpenSSL source
|
||||
|
||||
### chef_nginx::passenger
|
||||
|
||||
These attributes are used in the `chef_nginx::passenger` recipe.
|
||||
@@ -184,13 +191,6 @@ Basic configuration to use the official Phusion Passenger repositories:
|
||||
- `node['nginx']['package_name']` - 'nginx-extras'
|
||||
- `node['nginx']['passenger']['install_method']` - 'package'
|
||||
|
||||
### chef_nginx::openssl_source
|
||||
|
||||
These attributes are used in the `chef_nginx::openssl_source` recipe.
|
||||
|
||||
- `node['nginx']['openssl_source']['version']` - The version of OpenSSL you want to download and use (default: 1.0.1t)
|
||||
- `node['nginx']['openssl_source']['url']` - The url for the OpenSSL source
|
||||
|
||||
### chef_nginx::rate_limiting
|
||||
|
||||
- `node['nginx']['enable_rate_limiting']` - set to true to enable rate limiting (`limit_req_zone` in nginx.conf)
|
||||
@@ -198,6 +198,11 @@ These attributes are used in the `chef_nginx::openssl_source` recipe.
|
||||
- `node['nginx']['rate_limiting_backoff']` - sets the backoff time for `limit_req_zone`.
|
||||
- `node['nginx']['rate_limit']` - set the rate limit amount for `limit_req_zone`.
|
||||
|
||||
### chef_nginx::repo
|
||||
|
||||
- `node['nginx']['upstream_repository']` - the URL to use for the package repository resource; default is set based on platform type
|
||||
- `node['nginx']['repo_signing_key']` - The URL from which package signing/gpg key is retrieved
|
||||
|
||||
### chef_nginx::socketproxy
|
||||
|
||||
These attributes are used in the `chef_nginx::socketproxy` recipe.
|
||||
|
||||
@@ -41,11 +41,7 @@ default['nginx']['repo_source'] = 'nginx'
|
||||
default['nginx']['install_method'] = 'package'
|
||||
|
||||
case node['platform_family']
|
||||
when 'debian'
|
||||
default['nginx']['user'] = 'www-data'
|
||||
when 'rhel'
|
||||
default['nginx']['user'] = 'nginx'
|
||||
when 'fedora'
|
||||
when 'rhel', 'fedora', 'amazon'
|
||||
default['nginx']['user'] = 'nginx'
|
||||
when 'freebsd'
|
||||
default['nginx']['package_name'] = 'www/nginx'
|
||||
@@ -57,7 +53,7 @@ when 'freebsd'
|
||||
when 'suse'
|
||||
default['nginx']['user'] = 'wwwrun'
|
||||
default['nginx']['group'] = 'www'
|
||||
else
|
||||
else # debian probably
|
||||
default['nginx']['user'] = 'www-data'
|
||||
end
|
||||
|
||||
|
||||
@@ -19,17 +19,24 @@
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
case node['platform_family']
|
||||
when 'rhel', 'fedora'
|
||||
default['nginx']['upstream_repository'] = case node['platform']
|
||||
when 'centos'
|
||||
# See http://wiki.nginx.org/Install
|
||||
"http://nginx.org/packages/centos/#{node['platform_version'].to_i}/$basearch/"
|
||||
when 'amazon'
|
||||
'http://nginx.org/packages/rhel/6/$basearch/'
|
||||
else
|
||||
"http://nginx.org/packages/rhel/#{node['platform_version'].to_i}/$basearch/"
|
||||
end
|
||||
when 'debian'
|
||||
default['nginx']['upstream_repository'] = "http://nginx.org/packages/#{node['platform']}"
|
||||
end
|
||||
default['nginx']['upstream_repository'] =
|
||||
case node['platform_family']
|
||||
when 'amazon' # Chef 13+ on amazon linux
|
||||
'http://nginx.org/packages/rhel/6/$basearch/'
|
||||
when 'rhel', 'fedora'
|
||||
case node['platform']
|
||||
when 'centos'
|
||||
# See http://wiki.nginx.org/Install
|
||||
"http://nginx.org/packages/centos/#{node['platform_version'].to_i}/$basearch/"
|
||||
when 'amazon' # Chef < 13 on Amazon
|
||||
'http://nginx.org/packages/rhel/6/$basearch/'
|
||||
else
|
||||
"http://nginx.org/packages/rhel/#{node['platform_version'].to_i}/$basearch/"
|
||||
end
|
||||
when 'debian'
|
||||
"http://nginx.org/packages/#{node['platform']}"
|
||||
when 'suse'
|
||||
'http://nginx.org/packages/sles/12'
|
||||
end
|
||||
|
||||
default['nginx']['repo_signing_key'] = 'http://nginx.org/keys/nginx_signing.key'
|
||||
|
||||
37
cookbooks/chef_nginx/libraries/nginx_version.rb
Normal file
37
cookbooks/chef_nginx/libraries/nginx_version.rb
Normal file
@@ -0,0 +1,37 @@
|
||||
class NginxVersion
|
||||
include Comparable
|
||||
|
||||
attr_reader :version
|
||||
|
||||
def initialize(version)
|
||||
@version = version
|
||||
end
|
||||
|
||||
def <=>(other)
|
||||
lhsegments = segments
|
||||
rhsegments = other.segments
|
||||
|
||||
parts = [lhsegments.size, rhsegments.size].max
|
||||
|
||||
(0..(parts - 1)).each do |index|
|
||||
lhs = lhsegments[index] || 0
|
||||
rhs = rhsegments[index] || 0
|
||||
|
||||
next if lhs == rhs
|
||||
|
||||
return lhs <=> rhs
|
||||
end
|
||||
|
||||
0
|
||||
end
|
||||
|
||||
def to_s
|
||||
version
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def segments
|
||||
version.split('.').map { |part| Integer(part) }
|
||||
end
|
||||
end
|
||||
File diff suppressed because one or more lines are too long
@@ -43,7 +43,7 @@ end
|
||||
end
|
||||
end
|
||||
|
||||
if !node['nginx']['default_site_enabled'] && platform_family?('rhel', 'fedora')
|
||||
if !node['nginx']['default_site_enabled'] && platform_family?('rhel', 'fedora', 'amazon')
|
||||
%w(default.conf example_ssl.conf).each do |config|
|
||||
file "/etc/nginx/conf.d/#{config}" do
|
||||
action :delete
|
||||
|
||||
@@ -22,7 +22,7 @@ remote_file psol_src_filepath do
|
||||
end
|
||||
|
||||
package_array = value_for_platform_family(
|
||||
%w(rhel) => node['nginx']['pagespeed']['packages']['rhel'],
|
||||
%w(rhel amazon) => node['nginx']['pagespeed']['packages']['rhel'],
|
||||
%w(debian) => node['nginx']['pagespeed']['packages']['debian']
|
||||
)
|
||||
|
||||
|
||||
@@ -18,16 +18,12 @@
|
||||
#
|
||||
|
||||
packages = value_for_platform_family(
|
||||
%w(rhel) => node['nginx']['passenger']['packages']['rhel'],
|
||||
%w(rhel amazon) => node['nginx']['passenger']['packages']['rhel'],
|
||||
%w(fedora) => node['nginx']['passenger']['packages']['fedora'],
|
||||
%w(debian) => node['nginx']['passenger']['packages']['debian']
|
||||
)
|
||||
|
||||
unless packages.empty?
|
||||
packages.each do |name|
|
||||
package name
|
||||
end
|
||||
end
|
||||
package packages unless packages.empty?
|
||||
|
||||
gem_package 'rake' if node['nginx']['passenger']['install_rake']
|
||||
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
#
|
||||
|
||||
case node['platform_family']
|
||||
when 'rhel'
|
||||
when 'rhel', 'amazon'
|
||||
|
||||
yum_repository 'nginx' do
|
||||
description 'Nginx.org Repository'
|
||||
baseurl node['nginx']['upstream_repository']
|
||||
gpgkey 'http://nginx.org/keys/nginx_signing.key'
|
||||
gpgkey node['nginx']['repo_signing_key']
|
||||
action :create
|
||||
end
|
||||
|
||||
@@ -32,8 +32,8 @@ when 'suse'
|
||||
|
||||
zypper_repo 'nginx' do
|
||||
repo_name 'Nginx.org Repository'
|
||||
uri 'http://nginx.org/packages/sles/12'
|
||||
key 'http://nginx.org/keys/nginx_signing.key'
|
||||
uri node['nginx']['upstream_repository']
|
||||
key node['nginx']['repo_signing_key']
|
||||
end
|
||||
|
||||
when 'debian'
|
||||
@@ -43,7 +43,7 @@ when 'debian'
|
||||
distribution node['lsb']['codename']
|
||||
components %w(nginx)
|
||||
deb_src true
|
||||
key 'http://nginx.org/keys/nginx_signing.key'
|
||||
key node['nginx']['repo_signing_key']
|
||||
end
|
||||
|
||||
else
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
raise "#{node['platform']} is not a supported platform in the nginx::source recipe" unless platform_family?('rhel', 'fedora', 'debian', 'suse')
|
||||
raise "#{node['platform']} is not a supported platform in the nginx::source recipe" unless platform_family?('rhel', 'amazon', 'fedora', 'debian', 'suse')
|
||||
|
||||
node.normal['nginx']['binary'] = node['nginx']['source']['sbin_path']
|
||||
node.normal['nginx']['daemon_disable'] = true
|
||||
@@ -42,7 +42,7 @@ src_filepath = "#{Chef::Config['file_cache_path']}/nginx-#{node['nginx']['source
|
||||
|
||||
# install prereqs
|
||||
package value_for_platform_family(
|
||||
%w(rhel fedora) => %w(pcre-devel openssl-devel tar),
|
||||
%w(rhel fedora amazon) => %w(pcre-devel openssl-devel tar),
|
||||
%w(suse) => %w(pcre-devel libopenssl-devel tar),
|
||||
%w(debian) => %w(libpcre3 libpcre3-dev libssl-dev tar)
|
||||
)
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
set_real_ip_from <%= address %>;
|
||||
<% end -%>
|
||||
real_ip_header <%= node['nginx']['realip']['header'] %>;
|
||||
<% if node['nginx']['version'].to_f >= 1.2 -%>
|
||||
<% if NginxVersion.new(node['nginx']['version']) >= NginxVersion.new('1.2') -%>
|
||||
real_ip_recursive <%= node['nginx']['realip']['real_ip_recursive'] %>;
|
||||
<% end -%>
|
||||
|
||||
Reference in New Issue
Block a user