Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove legacy top-scope syntax #1031

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ the default `collectd.conf` file shipped with collectd. This can
be done by simply including the class:

```puppet
include ::collectd
include collectd
```

Collectd is most useful when configured with customized plugins.
Expand All @@ -30,7 +30,7 @@ configurations. Configure a node with the following class
declaration:

```puppet
class { '::collectd':
class { 'collectd':
purge => true,
recurse => true,
purge_config => true,
Expand Down Expand Up @@ -1635,7 +1635,7 @@ collectd::config::typesdb:
```

```puppet
class { '::collectd::plugin::rabbitmq':
class { 'collectd::plugin::rabbitmq':
config => {
'Username' => 'admin',
'Password' => $admin_pass,
Expand Down Expand Up @@ -1683,7 +1683,7 @@ class {'collectd::plugin::sensors':
#### Class: `collectd::plugin::smart`

```puppet
class { '::collectd::plugin::smart':
class { 'collectd::plugin::smart':
disks => ['/^dm/'],
ignoreselected => true,
}
Expand Down Expand Up @@ -1848,7 +1848,7 @@ collectd::plugin::tail::file { 'exim-log':
#### Class: `collectd::plugin::tail_csv`

```puppet
class { '::collectd::plugin::tail_csv':
class { 'collectd::plugin::tail_csv':
metrics => {
'snort-dropped' => {
'type' => 'gauge',
Expand All @@ -1871,7 +1871,7 @@ class { '::collectd::plugin::tail_csv':
#### Class: `collectd::plugin::thermal`

```puppet
class { '::collectd::plugin::thermal':
class { 'collectd::plugin::thermal':
devices => ['foo0'],
ignoreselected => false,
}
Expand Down
4 changes: 2 additions & 2 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
if $collectd::manage_repo {
$osfamily_downcase = downcase($facts['os']['family'])

if defined("::collectd::repo::${osfamily_downcase}") {
require "::collectd::repo::${osfamily_downcase}"
if defined("collectd::repo::${osfamily_downcase}") {
require "collectd::repo::${osfamily_downcase}"
} else {
notify { "You have asked to manage_repo on a system that doesn't have a repo class specified: ${facts['os']['family']}": }
}
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ class { 'collectd::plugin::csv':}
context 'install plugins' do
it 'works idemptontently' do
pp = <<-EOS
class { '::collectd': }
class { 'collectd': }

class { '::collectd::plugin::memory': }
class { 'collectd::plugin::memory': }

class { 'collectd::plugin::csv':}
EOS
Expand Down
48 changes: 24 additions & 24 deletions templates/plugin/amqp1.conf.epp
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
<Plugin amqp1>
<Transport "<%= $::collectd::plugin::amqp1::transport %>">
Host "<%= $::collectd::plugin::amqp1::host %>"
Port "<%= $::collectd::plugin::amqp1::port %>"
User "<%= $::collectd::plugin::amqp1::user %>"
Password "<%= $::collectd::plugin::amqp1::password %>"
Address "<%= $::collectd::plugin::amqp1::address %>"
<% unless $::collectd::plugin::amqp1::retry_delay =~ Undef { -%>
RetryDelay <%= $::collectd::plugin::amqp1::retry_delay %>
<% } -%>
<% unless $::collectd::plugin::amqp1::send_queue_limit =~ Undef { -%>
SendQueueLimit <%= $::collectd::plugin::amqp1::send_queue_limit %>
<% } -%>
<% $::collectd::plugin::amqp1::instances.keys.sort.each |$name| { -%>
<Transport "<%= $collectd::plugin::amqp1::transport %>">
Host "<%= $collectd::plugin::amqp1::host %>"
Port "<%= $collectd::plugin::amqp1::port %>"
User "<%= $collectd::plugin::amqp1::user %>"
Password "<%= $collectd::plugin::amqp1::password %>"
Address "<%= $collectd::plugin::amqp1::address %>"
<% unless $collectd::plugin::amqp1::retry_delay =~ Undef { -%>
RetryDelay <%= $collectd::plugin::amqp1::retry_delay %>
<% } -%>
<% unless $collectd::plugin::amqp1::send_queue_limit =~ Undef { -%>
SendQueueLimit <%= $collectd::plugin::amqp1::send_queue_limit %>
<% } -%>
<% $collectd::plugin::amqp1::instances.keys.sort.each |$name| { -%>
<Instance "<%= $name %>">
<% $::collectd::plugin::amqp1::instances[$name].keys.sort.each |$key| { -%>
<% $collectd::plugin::amqp1::instances[$name].keys.sort.each |$key| { -%>
<% if $key == 'format' { -%>
Format "<%= $::collectd::plugin::amqp1::instances[$name][$key] %>"
Format "<%= $collectd::plugin::amqp1::instances[$name][$key] %>"
<% } -%>
<% if $key == 'presettle' { -%>
PreSettle <%= $::collectd::plugin::amqp1::instances[$name][$key] %>
PreSettle <%= $collectd::plugin::amqp1::instances[$name][$key] %>
<% } -%>
<% if $key == 'notify' { -%>
Notify <%= $::collectd::plugin::amqp1::instances[$name][$key] %>
Notify <%= $collectd::plugin::amqp1::instances[$name][$key] %>
<% } -%>
<% if $key == 'store_rates' { -%>
StoreRates <%= $::collectd::plugin::amqp1::instances[$name][$key] %>
StoreRates <%= $collectd::plugin::amqp1::instances[$name][$key] %>
<% } -%>
<% if $key == 'graphite_prefix' { -%>
GraphitePrefix "<%= $::collectd::plugin::amqp1::instances[$name][$key] %>"
GraphitePrefix "<%= $collectd::plugin::amqp1::instances[$name][$key] %>"
<% } -%>
<% if $key == 'graphite_postfix' { -%>
GraphitePostfix "<%= $::collectd::plugin::amqp1::instances[$name][$key] %>"
GraphitePostfix "<%= $collectd::plugin::amqp1::instances[$name][$key] %>"
<% } -%>
<% if $key == 'graphite_escape_char' { -%>
GraphiteEscapeChar "<%= $::collectd::plugin::amqp1::instances[$name][$key] %>"
GraphiteEscapeChar "<%= $collectd::plugin::amqp1::instances[$name][$key] %>"
<% } -%>
<% if $key == 'graphite_separate_instances' { -%>
GraphiteSeparateInstances <%= $::collectd::plugin::amqp1::instances[$name][$key] %>
GraphiteSeparateInstances <%= $collectd::plugin::amqp1::instances[$name][$key] %>
<% } -%>
<% if $key == 'graphite_always_append_ds' { -%>
GraphiteAlwaysAppendDS <%= $::collectd::plugin::amqp1::instances[$name][$key] %>
GraphiteAlwaysAppendDS <%= $collectd::plugin::amqp1::instances[$name][$key] %>
<% } -%>
<% if $key == 'graphite_preserve_separator' { -%>
GraphitePreserveSeparator <%= $::collectd::plugin::amqp1::instances[$name][$key] %>
GraphitePreserveSeparator <%= $collectd::plugin::amqp1::instances[$name][$key] %>
<% } -%>
<% } -%>
</Instance>
Expand Down
18 changes: 9 additions & 9 deletions templates/plugin/cpu.conf.epp
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<% if versioncmp($::collectd::collectd_version_real, '5.5') >= 0 { -%>
<% if versioncmp($collectd::collectd_version_real, '5.5') >= 0 { -%>
<Plugin cpu>
ReportByState <%= $::collectd::plugin::cpu::reportbystate %>
ReportByCpu <%= $::collectd::plugin::cpu::reportbycpu %>
ValuesPercentage <%= $::collectd::plugin::cpu::valuespercentage %>
<% if versioncmp($::collectd::collectd_version_real, '5.6') >= 0 { -%>
ReportNumCpu <%= $::collectd::plugin::cpu::reportnumcpu %>
ReportByState <%= $collectd::plugin::cpu::reportbystate %>
ReportByCpu <%= $collectd::plugin::cpu::reportbycpu %>
ValuesPercentage <%= $collectd::plugin::cpu::valuespercentage %>
<% if versioncmp($collectd::collectd_version_real, '5.6') >= 0 { -%>
ReportNumCpu <%= $collectd::plugin::cpu::reportnumcpu %>
<% } -%>
<% if versioncmp($::collectd::collectd_version_real, '5.8') >= 0 { -%>
ReportGuestState <%= $::collectd::plugin::cpu::reportgueststate %>
SubtractGuestState <%= $::collectd::plugin::cpu::subtractgueststate %>
<% if versioncmp($collectd::collectd_version_real, '5.8') >= 0 { -%>
ReportGuestState <%= $collectd::plugin::cpu::reportgueststate %>
SubtractGuestState <%= $collectd::plugin::cpu::subtractgueststate %>
<% } -%>
</Plugin>
<% } -%>
12 changes: 6 additions & 6 deletions templates/plugin/procevent.conf.epp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Plugin procevent>
<% unless $::collectd::plugin::procevent::process =~ Undef { -%>
Process "<%= $::collectd::plugin::procevent::process %>"
<% unless $collectd::plugin::procevent::process =~ Undef { -%>
Process "<%= $collectd::plugin::procevent::process %>"
<% } -%>
<% unless $::collectd::plugin::procevent::process_regex =~ Undef { -%>
ProcessRegex "<%= $::collectd::plugin::procevent::process_regex %>"
<% unless $collectd::plugin::procevent::process_regex =~ Undef { -%>
ProcessRegex "<%= $collectd::plugin::procevent::process_regex %>"
<% } -%>
<% unless $::collectd::plugin::procevent::buffer_length =~ Undef { -%>
BufferLength <%= $::collectd::plugin::procevent::buffer_length %>
<% unless $collectd::plugin::procevent::buffer_length =~ Undef { -%>
BufferLength <%= $collectd::plugin::procevent::buffer_length %>
<% } -%>
</Plugin>
16 changes: 8 additions & 8 deletions templates/plugin/swap.conf.epp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Plugin swap>
ReportByDevice <%= $::collectd::plugin::swap::reportbydevice %>
<% if versioncmp($::collectd::collectd_version_real, '5.2') > 0 { -%>
ReportBytes <%= $::collectd::plugin::swap::reportbytes %>
ReportByDevice <%= $collectd::plugin::swap::reportbydevice %>
<% if versioncmp($collectd::collectd_version_real, '5.2') > 0 { -%>
ReportBytes <%= $collectd::plugin::swap::reportbytes %>
<% } -%>
<% if versioncmp($::collectd::collectd_version_real, '5.5') > 0 { -%>
ValuesAbsolute <%= $::collectd::plugin::swap::valuesabsolute %>
ValuesPercentage <%= $::collectd::plugin::swap::valuespercentage %>
<% if versioncmp($collectd::collectd_version_real, '5.5') > 0 { -%>
ValuesAbsolute <%= $collectd::plugin::swap::valuesabsolute %>
ValuesPercentage <%= $collectd::plugin::swap::valuespercentage %>
<% } -%>
<% if versioncmp($::collectd::collectd_version_real, '5.8') > 0 { -%>
ReportIO <%= $::collectd::plugin::swap::reportio %>
<% if versioncmp($collectd::collectd_version_real, '5.8') > 0 { -%>
ReportIO <%= $collectd::plugin::swap::reportio %>
<% } -%>
</Plugin>
12 changes: 6 additions & 6 deletions templates/plugin/sysevent.conf.epp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Plugin sysevent>
Listen "<%= $::collectd::plugin::sysevent::listen_host %>" "<%= $::collectd::plugin::sysevent::listen_port %>"
RegexFilter "<%= $::collectd::plugin::sysevent::regex_filter %>"
<% unless $::collectd::plugin::sysevent::buffer_size =~ Undef { -%>
BufferSize <%= $::collectd::plugin::sysevent::buffer_size %>
Listen "<%= $collectd::plugin::sysevent::listen_host %>" "<%= $collectd::plugin::sysevent::listen_port %>"
RegexFilter "<%= $collectd::plugin::sysevent::regex_filter %>"
<% unless $collectd::plugin::sysevent::buffer_size =~ Undef { -%>
BufferSize <%= $collectd::plugin::sysevent::buffer_size %>
<% } -%>
<% unless $::collectd::plugin::sysevent::buffer_length =~ Undef { -%>
BufferLength <%= $::collectd::plugin::sysevent::buffer_length %>
<% unless $collectd::plugin::sysevent::buffer_length =~ Undef { -%>
BufferLength <%= $collectd::plugin::sysevent::buffer_length %>
<% } -%>
</Plugin>