diff --git a/CHANGELOG.md b/CHANGELOG.md index 01ac0eb..4c5870d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,41 +1,44 @@ # Change Log Release notes for the claranet/puppet-varnish module. ------------------------------------------ +## 4.1.4 - 2017-10-20 + * Fixing Puppet 3 bug in handling of `undef` values of `varnish::instance_name` in ERB templates + ## 4.1.3 - 2017-10-17 * Fixing other syntax errors, pull requests [#45](https://github.com/claranet/puppet-varnish/issues/45) and [#46](https://github.com/claranet/puppet-varnish/issues/46) ## 4.1.2 - 2017-10-12 * Fixing syntax error in previous release ## 4.1.1 - 2017-10-12 * Varnish 4+ requires passing multiple listen interfaces by specifying multiple `-a` flags, not a single comma-separated value. * Various Puppet 3 fixes ## 4.1.0 - 2017-10-10 * New parameter: `varnish::instance_name` - allows setting Varnish's instance name - fixes [#44](https://github.com/claranet/puppet-varnish/issues/44) * Parameter `listen` now accepts an array to set multiple listen interfaces - fixes [#33](https://github.com/claranet/puppet-varnish/issues/33) ## 4.0.0 - 2017-10-04 * Major version increase after module move to Claranet GitHub org * Adds Varnish 5 support (5.0, 5.1 and 5.2) * Removes old repository and moves to Pacakgecloud * Default Varnish version changed to 4.1 for all OS families * Systemd service set up depending on Varnish/OS version ## 3.0.0 - 2015-07-20 * Add support for Debian Wheezy + Jessie * Fix Varnish vcl_reload command ## 2.4.1 - 2015-06-25 * Relax puppetlabs-apt version dependency because of librarian issues ## 2.4.0 - 2015-06-12 * Added support for Ubuntu 14.04 * Passing secret is now optional (but still supported) ## 2.3.0 - 2015-04-13 * Added support for Ubuntu 12.04 * Improved tests for Varnish 4 on EL6 diff --git a/metadata.json b/metadata.json index a3dc6d8..2033fc9 100644 --- a/metadata.json +++ b/metadata.json @@ -1,47 +1,47 @@ { "name" : "claranet-varnish", - "version" : "4.1.3", + "version" : "4.1.4", "source" : "https://github.com/claranet/puppet-varnish", "author" : "Claranet", "license" : "Apache-2.0", "summary" : "Install and configure Varnish Cache", "description" : "Install and configure Varnish Cache", "project_page" : "https://github.com/claranet/puppet-varnish", "issues_url" : "https://github.com/claranet/puppet-varnish/issues", "tags" : [ "varnish", "cache", "http" ], "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ "6", "7" ] }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "14.04", "16.04" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ "7", "8" ] } ], "requirements": [ { "name": "puppet", "version_requirement": ">= 3.8.7" } ], "dependencies": [ { "name": "stahnma/epel", "version_requirement": ">= 1.2.0 < 2.0.0" }, { "name": "puppet/selinux", "version_requirement": ">= 0.8.0 < 1.0.0" }, { "name": "puppetlabs/apt", "version_requirement": ">= 2.0.0 < 3.0.0" }, { "name": "puppetlabs/stdlib", "version_requirement": ">=1.0.0 < 5.0.0" } ] } diff --git a/templates/sysconfig.erb b/templates/sysconfig.erb index 7953748..9a504de 100644 --- a/templates/sysconfig.erb +++ b/templates/sysconfig.erb @@ -1,53 +1,53 @@ ############################################ # WARNING: # Managed by Puppet - DO NOT modify locally! ############################################ START=yes NFILES=131072 MEMLOCK=82000 RELOAD_VCL=1 VARNISH_VCL_CONF=<%= scope['::varnish::vcl_conf'] %> <% if scope['::varnish::version_major'] == 3 sep = ',' else sep = ' -a ' end if scope['::varnish::listen'].is_a?(Array) -%> VARNISH_LISTEN="-a <% scope['::varnish::listen'].each_with_index do |addr, idx| %><%= addr %><% unless addr.include?(':') %>:<%= scope['::varnish::listen_port'] %><% end -%><% if idx != (scope['::varnish::listen'].length-1) -%><%= sep %><% end -%><% end %>" <% else -%> VARNISH_LISTEN="-a <%= scope['::varnish::listen'] %>:<%= scope['::varnish::listen_port'] %>" <% end -%> VARNISH_ADMIN_LISTEN_ADDRESS=<%= scope['::varnish::admin_listen'] %> VARNISH_ADMIN_LISTEN_PORT=<%= scope['::varnish::admin_port'] %> VARNISH_SECRET_FILE=<%= scope['::varnish::secret_file'] %> VARNISH_MIN_THREADS=<%= scope['::varnish::min_threads'] %> VARNISH_MAX_THREADS=<%= scope['::varnish::max_threads'] %> VARNISH_THREAD_TIMEOUT=<%= scope['::varnish::thread_timeout'] %> VARNISH_STORAGE=<%= scope['::varnish::storage_type'] %>,<% if scope['::varnish::storage_type'] == 'file' -%><%= scope['::varnish::storage_file'] %>,<% end -%><%= scope['::varnish::storage_size'] %> VARNISH_TTL=120 DAEMON_OPTS="<% if scope['::varnish::params::service_provider'] == 'sysvinit' -%><%= scope['::varnish::config::jail_opt'] %> \<% end %> ${VARNISH_LISTEN} \ -<% if scope['::varnish::instance_name'] != :undefined -%> +<% unless [nil, :undefined, :undef, ''].include?(scope['::varnish::instance_name']) -%> -n <%= scope['::varnish::instance_name'] %> \ <% end -%> -f ${VARNISH_VCL_CONF} \ -T ${VARNISH_ADMIN_LISTEN_ADDRESS}:${VARNISH_ADMIN_LISTEN_PORT} \ -t ${VARNISH_TTL} \ <% if scope['::varnish::version_major'] == '3' -%> -w ${VARNISH_MIN_THREADS},${VARNISH_MAX_THREADS},${VARNISH_THREAD_TIMEOUT} \ <% else -%> -p thread_pool_min=${VARNISH_MIN_THREADS} \ -p thread_pool_max=${VARNISH_MAX_THREADS} \ -p thread_pool_timeout=${VARNISH_THREAD_TIMEOUT} \ <% end -%> <% scope['::varnish::runtime_params'].each do |k,v| -%> -p <%= k %>=<%= v %> \ <% end -%> -S ${VARNISH_SECRET_FILE} \ -s ${VARNISH_STORAGE}" diff --git a/templates/varnish.service.erb b/templates/varnish.service.erb index 0540b35..4faf9ef 100644 --- a/templates/varnish.service.erb +++ b/templates/varnish.service.erb @@ -1,47 +1,47 @@ [Unit] Description=Varnish HTTP accelerator [Service] Type=forking LimitNOFILE=131072 LimitMEMLOCK=82000 LimitCORE=infinity PrivateTmp=true ExecReload=<%= scope['::varnish::vcl_reload'] %> ExecStart=/usr/sbin/varnishd <%= scope['::varnish::config::jail_opt'] %> \ -P /var/run/varnish.pid \ -t 120 \ -<% if scope['::varnish::instance_name'] != :undefined -%> +<% unless [nil, :undefined, :undef, ''].include?(scope['::varnish::instance_name']) -%> -n <%= scope['::varnish::instance_name'] %> \ <% end -%> -f <%= scope['::varnish::vcl_conf'] %> \ <% if scope['::varnish::version_major'] == 3 sep = ',' else sep = ' -a ' end if scope['::varnish::listen'].is_a?(Array) -%> -a <% scope['::varnish::listen'].each_with_index do |addr, idx| %><%= addr %><% unless addr.include?(':') %>:<%= scope['::varnish::listen_port'] %><% end -%><% if idx != (scope['::varnish::listen'].length-1) -%><%= sep %><% end -%><% end %> \ <% else -%> -a <%= scope['::varnish::listen'] %>:<%= scope['::varnish::listen_port'] %> \ <% end -%> -T <%= scope['::varnish::admin_listen'] %>:<%= scope['::varnish::admin_port'] %> \ <% if scope['::varnish::version_major'] == '3' -%> -w <%= scope['::varnish::min_threads'] %>,<%= scope['::varnish::max_threads'] %>,<%= scope['::varnish::thread_timeout'] %> \ <% else -%> -p thread_pool_min=<%= scope['::varnish::min_threads'] %> \ -p thread_pool_max=<%= scope['::varnish::max_threads'] %> \ -p thread_pool_timeout=<%= scope['::varnish::thread_timeout'] %> \ <% end -%> <% scope['::varnish::runtime_params'].each do |k,v| -%> -p <%= k %>=<%= v %> \ <% end -%> -S <%= scope['::varnish::secret_file'] %> \ -s <%= scope['::varnish::storage_type'] %>,<% if scope['::varnish::storage_type'] == 'file' -%><%= scope['::varnish::storage_file'] %>,<% end -%><%= scope['::varnish::storage_size'] %> [Install] WantedBy=multi-user.target