diff --git a/CHANGELOG.md b/CHANGELOG.md index 7114351..5133bc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,54 +1,60 @@ # Change Log Release notes for the claranet/puppet-varnish module. ------------------------------------------ +## 5.0.0 - 2018-02-27 + +### Breaking/Backwards-Incompatible Changes - Puppet 4 Syntax + * Parameters are validated against Puppet 4 data types + * Stdlib version requirements have been raised + ## 4.2.0 - 2018-02-26 * New parameter: `varnish::storage_additional` - allows setting multiple storage backends, pull request [#52](https://github.com/claranet/puppet-varnish/issues/52) * Adding deprecation notices for Puppet 3 ## 4.1.6 - 2017-12-13 * Fixing version-comparison bug for Debian 8.0 ## 4.1.5 - 2017-11-03 * Adding fully-qualified paths to `varnish_reload_vcl` for all Varnish versions in CentOS 6 and 7 ## 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 PackageCloud * 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/manifests/init.pp b/manifests/init.pp index 07008b9..eb9b5bd 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,124 +1,113 @@ # == Class: varnish # # Configure Varnish proxy cache # # === Parameters # # [*addrepo*] # Whether to add the official Varnish repos # [*secret*] # Varnish secret (used by varnishadm etc). # Optional; will be autogenerated if not specified # [*vcl_conf*] # Location of Varnish config file template # [*listen*] # IP address for HTTP to listen on # [*listen_port*] # Port to listen on for HTTP requests # [*admin_listen*] # IP address for admin requests - defaults to 127.0.0.1 # [*admin_port*] # Port for Varnish admin to listen on # [*min_threads*] # Varnish minimum thread pool size # [*max_threads*] # Varnish maximum thread pool size # [*thread_timeout*] # Thread timeout # [*storage_type*] # Whether to use malloc (RAM only) or file storage for cache # [*storage_size*] # Size of cache # [*storage_additional*] # Hash of additional storage backends containing strings in the varnish format (passed to -s) # [*varnish_version*] # Major Varnish version to use # [*vcl_reload*] # Script to use to load new Varnish config # [*package_ensure*] # Ensure specific package version for Varnish, eg 3.0.5-1.el6 # [*runtime_params*] # Hash of key:value runtime parameters # class varnish ( - $runtime_params = {}, - $addrepo = true, - $admin_listen = '127.0.0.1', - $admin_port = '6082', - $listen = '0.0.0.0', - $listen_port = '6081', - $secret = undef, - $secret_file = '/etc/varnish/secret', - $vcl_conf = '/etc/varnish/default.vcl', - $storage_type = 'file', - $storage_file = '/var/lib/varnish/varnish_storage.bin', - $storage_size = '1G', - $storage_additional = [], - $min_threads = '50', - $max_threads = '1000', - $thread_timeout = '120', - $varnish_version = '4.1', - $instance_name = undef, - $package_ensure = 'present', - $package_name = 'varnish', - $service_name = 'varnish', - $vcl_reload_cmd = undef, - $vcl_reload_path = $::path, + Hash $runtime_params = {}, + Boolean $addrepo = true, + String $admin_listen = '127.0.0.1', + Integer $admin_port = 6082, + Variant[String,Array] $listen = '0.0.0.0', + Integer $listen_port = 6081, + Optional[String] $secret = undef, + Stdlib::AbsolutePath $secret_file = '/etc/varnish/secret', + Stdlib::AbsolutePath $vcl_conf = '/etc/varnish/default.vcl', + Enum['file','malloc'] $storage_type = 'file', + Stdlib::AbsolutePath $storage_file = '/var/lib/varnish/varnish_storage.bin', + String $storage_size = '1G', + Array $storage_additional = [], + Integer $min_threads = 50, + Integer $max_threads = 1000, + Integer $thread_timeout = 120, + Pattern[/^[3-5]\.[0-9]/] $varnish_version = '4.1', + Optional[String] $instance_name = undef, + String $package_ensure = 'present', + String $package_name = 'varnish', + String $service_name = 'varnish', + Optional[String] $vcl_reload_cmd = undef, + String $vcl_reload_path = $::path, ) { if $package_ensure == 'present' { $version_major = regsubst($varnish_version, '^(\d+)\.(\d+).*$', '\1') $version_minor = regsubst($varnish_version, '^(\d+)\.(\d+).*$', '\2') $version_full = $varnish_version } else { $version_major = regsubst($package_ensure, '^(\d+)\.(\d+).*$', '\1') $version_minor = regsubst($package_ensure, '^(\d+)\.(\d+).*$', '\2') $version_full = "${version_major}.${version_minor}" if $varnish_version != "${version_major}.${version_minor}" { fail("Version mismatch, varnish_version is ${varnish_version}, but package_ensure is ${version_full}") } } include ::varnish::params if $vcl_reload_cmd == undef { $vcl_reload = $::varnish::params::vcl_reload } else { $vcl_reload = $vcl_reload_cmd } - validate_bool($addrepo) - validate_string($secret) - validate_absolute_path($secret_file) - unless is_integer($admin_port) { fail('admin_port invalid') } - unless is_integer($min_threads) { fail('min_threads invalid') } - unless is_integer($max_threads) { fail('max_threads invalid') } - validate_absolute_path($storage_file) - validate_hash($runtime_params) - validate_re($storage_type, '^(malloc|file)$') - validate_re("${version_major}.${version_minor}", '^[3-5]\.[0-9]') - if $addrepo { class { '::varnish::repo': before => Class['::varnish::install'], } } include ::varnish::install class { '::varnish::secret': secret => $secret, require => Class['::varnish::install'], } class { '::varnish::config': require => Class['::varnish::secret'], notify => Class['::varnish::service'], } class { '::varnish::service': require => Class['::varnish::config'], } } diff --git a/metadata.json b/metadata.json index 620173f..8e31ef2 100644 --- a/metadata.json +++ b/metadata.json @@ -1,47 +1,45 @@ { "name" : "claranet-varnish", - "version" : "4.2.0", + "version" : "5.0.0", "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" } - ], + "requirements": [ { "name": "puppet", "version_requirement": ">= 4.7.1 < 6.0.0" } ], "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" } ] }