File tree Expand file tree Collapse file tree 4 files changed +51
-11
lines changed
manifests/plugin/write_graphite
templates/plugin/write_graphite Expand file tree Collapse file tree 4 files changed +51
-11
lines changed Original file line number Diff line number Diff line change @@ -2000,17 +2000,22 @@ backend should have unique title:
20002000
20012001` ` ` puppet
20022002collectd::plugin::write_graphite::carbon {'secondary_graphite':
2003- graphitehost => 'graphite.example.org',
2004- graphiteport => 2004,
2005- graphiteprefix => '',
2006- protocol => 'udp',
2007- escapecharacter => '_',
2008- alwaysappendds => true,
2009- storerates => true,
2010- separateinstances => false,
2011- logsenderrors => true
2012- }
2013- ` ` `
2003+ graphitehost => 'graphite.example.org',
2004+ graphiteport => 2004,
2005+ graphiteprefix => '',
2006+ protocol => 'udp',
2007+ escapecharacter => '_',
2008+ alwaysappendds => true,
2009+ storerates => true,
2010+ separateinstances => false,
2011+ logsenderrors => true
2012+ preserveseparator => false,
2013+ dropduplicatefields => false,
2014+ }
2015+ ` ` `
2016+
2017+ The `preserveseparator` and `dropduplicatefields` fields are supported as of
2018+ collectd version >= 5.7.
20142019
20152020# ### Class: `collectd::plugin::write_http`
20162021
Original file line number Diff line number Diff line change 1414 Boolean $logsenderrors = true ,
1515 Integer $reconnectinterval = 0,
1616 Boolean $reversehost = false ,
17+ Boolean $preserveseparator = false ,
18+ Boolean $dropduplicatefields = false ,
1719) {
1820 include collectd
1921 include collectd::plugin::write_graphite
Original file line number Diff line number Diff line change 6969 it { is_expected . to contain_concat__fragment ( 'collectd_plugin_write_graphite_conf_graphite_default_tcp_2003' ) . with ( content : %r{Port "2003"} ) }
7070 end
7171 end
72+
73+ context 'starting with version 5.7 the preserveseparator and dropduplicatefields options should be supported' do
74+ let ( :title ) { 'graphite_default' }
75+
76+ let :params do
77+ {
78+ preserveseparator : true ,
79+ dropduplicatefields : true ,
80+ }
81+ end
82+
83+ context 'version 5.6' do
84+ let :facts do
85+ facts . merge ( collectd_version : '5.6' )
86+ end
87+
88+ it { is_expected . to contain_concat__fragment ( 'collectd_plugin_write_graphite_conf_graphite_default_tcp_2003' ) . without ( content : %r{PreserveSeparator} ) }
89+ it { is_expected . to contain_concat__fragment ( 'collectd_plugin_write_graphite_conf_graphite_default_tcp_2003' ) . without ( content : %r{DropDuplicateFields} ) }
90+ end
91+
92+ context 'version 5.7' do
93+ let :facts do
94+ facts . merge ( collectd_version : '5.7' )
95+ end
96+
97+ it { is_expected . to contain_concat__fragment ( 'collectd_plugin_write_graphite_conf_graphite_default_tcp_2003' ) . with ( content : %r{PreserveSeparator true} ) }
98+ it { is_expected . to contain_concat__fragment ( 'collectd_plugin_write_graphite_conf_graphite_default_tcp_2003' ) . with ( content : %r{DropDuplicateFields true} ) }
99+ end
100+ end
72101 end
73102end
Original file line number Diff line number Diff line change 2323<%- if scope . lookupvar ( 'collectd::collectd_version_real' ) and ( scope . function_versioncmp ( [ scope . lookupvar ( 'collectd::collectd_version_real' ) , '5.9' ] ) >= 0 ) -%>
2424 ReverseHost <%= @reversehost %>
2525<%- end -%>
26+ <%- if scope . lookupvar ( 'collectd::collectd_version_real' ) and ( scope . function_versioncmp ( [ scope . lookupvar ( 'collectd::collectd_version_real' ) , '5.7' ] ) >= 0 ) -%>
27+ PreserveSeparator <%= @preserveseparator %>
28+ DropDuplicateFields <%= @dropduplicatefields %>
29+ <%- end -%>
2630<%- if scope . lookupvar ( 'collectd::collectd_version_real' ) and ( scope . function_versioncmp ( [ scope . lookupvar ( 'collectd::collectd_version_real' ) , '5.3' ] ) >= 0 ) -%>
2731</ Node >
2832<%- else -%>
You can’t perform that action at this time.
0 commit comments