diff --git a/manifests/init.pp b/manifests/init.pp index d5851e4..4c83431 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -39,6 +39,8 @@ # Ensure specific package version for Varnish, eg 3.0.5-1.el6 # [*runtime_params*] # Hash of key:value runtime parameters +# [*proxy_protocol*] +# Boolean toggle support for the PROXY protocol. # class varnish ( Hash $runtime_params = {}, @@ -64,6 +66,7 @@ String $service_name = 'varnish', Optional[String] $vcl_reload_cmd = undef, String $vcl_reload_path = $facts['path'], + Boolean $proxy_protocol = false, ) { if $package_ensure == 'present' { $version_major = regsubst($varnish_version, '^(\d+)\.(\d+).*$', '\1') diff --git a/manifests/params.pp b/manifests/params.pp index 436233c..b30a6c8 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -28,7 +28,24 @@ '3' => '/usr/bin/varnish_reload_vcl', } } - + '8': { + $os_service_provider = 'systemd' + $vcl_reload = $varnish::version_major ? { + '6' => '/usr/sbin/varnishreload', + '5' => '/sbin/varnish_reload_vcl', + '4' => '/usr/sbin/varnish_reload_vcl', + '3' => '/usr/bin/varnish_reload_vcl', + } + } + '9': { + $os_service_provider = 'systemd' + $vcl_reload = $varnish::version_major ? { + '6' => '/usr/sbin/varnishreload', + '5' => '/sbin/varnish_reload_vcl', + '4' => '/usr/sbin/varnish_reload_vcl', + '3' => '/usr/bin/varnish_reload_vcl', + } + } default: { $os_service_provider = 'systemd' $vcl_reload = '/usr/sbin/varnish_reload_vcl' diff --git a/manifests/repo.pp b/manifests/repo.pp index bd4c6dc..ab40c03 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -36,6 +36,8 @@ gpgcheck => '0', sslverify => '1', sslcacert => '/etc/pki/tls/certs/ca-bundle.crt', + enabled => '1', + priority => '1', } yumrepo { 'varnish-cache-source': @@ -47,6 +49,8 @@ gpgcheck => '0', sslverify => '1', sslcacert => '/etc/pki/tls/certs/ca-bundle.crt', + enabled => '1', + priority => '1', } } diff --git a/templates/varnish.service.erb b/templates/varnish.service.erb index baacdde..68f65c0 100644 --- a/templates/varnish.service.erb +++ b/templates/varnish.service.erb @@ -29,9 +29,9 @@ ExecStart=/usr/sbin/varnishd <%= scope['::varnish::config::jail_opt'] %> \ 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 %> \ + -a <% scope['::varnish::listen'].each_with_index do |addr, idx| %><%= addr %><% unless addr.include?(':') %>:<%= scope['::varnish::listen_port'] %><%= scope['::varnish::proxy_protocol'] ? ',PROXY' : '' %><% end -%><% if idx != (scope['::varnish::listen'].length-1) -%><%= sep %><% end -%><% end %> \ <% else -%> - -a <%= scope['::varnish::listen'] %>:<%= scope['::varnish::listen_port'] %> \ + -a <%= scope['::varnish::listen'] %>:<%= scope['::varnish::listen_port'] %><%= scope['::varnish::proxy_protocol'] ? ',PROXY' : '' %> \ <% end -%> -T <%= scope['::varnish::admin_listen'] %>:<%= scope['::varnish::admin_port'] %> \ <% if scope['::varnish::version_major'] == '3' -%>