From fb26d091018a6b0d704ce84736f5e73f6aa63f12 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 14 Sep 2018 14:29:45 +1000 Subject: [PATCH] Have statsd listen on ipv6 by default By default we're not listening on an ipv6 address; so any stats sent there just go missing. Set up by default to listen to '::' (and add required ipv6 argument) which, thanks to dual-stack, means ipv4 & 6 packets are all accounted for. Change-Id: I1fec03b32441a1962190f9bd8e24e8bec2318ab5 --- manifests/init.pp | 3 +++ spec/acceptance/basic_spec.rb | 2 ++ templates/config.js.erb | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index 71518ec..e9acfa0 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -22,6 +22,9 @@ class graphite( } ], $vhost_name = $::fqdn, + # Have statsd listen on '::' which, thanks to dual-stack, + # gets ipv4 and ipv6 connections. + $statsd_ipv6_listen = true, ) { $packages = [ 'python-django', 'python-django-tagging', diff --git a/spec/acceptance/basic_spec.rb b/spec/acceptance/basic_spec.rb index 2a84139..8dbd680 100644 --- a/spec/acceptance/basic_spec.rb +++ b/spec/acceptance/basic_spec.rb @@ -80,6 +80,8 @@ describe 'puppet-graphite module', :if => ['debian', 'ubuntu'].include?(os[:fami it { should be_owned_by 'statsd' } it { should be_grouped_into 'statsd' } its(:content) { should include 'graphitePort: 2003' } + its(:content) { should include "address: '::'" } + end describe file('/etc/graphite/carbon.conf') do diff --git a/templates/config.js.erb b/templates/config.js.erb index c98692b..777bd75 100644 --- a/templates/config.js.erb +++ b/templates/config.js.erb @@ -56,4 +56,8 @@ Optional Variables: , port: 8125 , deleteTimers: true , deleteCounters: true +<% if @statsd_ipv6_listen %> +, address: '::', +, address_ipv6: true +<% end %> }