Skip to content

Commit 17207e9

Browse files
bastelfreakarchii
authored andcommitted
puppet-lint: fix topscope_variable
1 parent c9afba3 commit 17207e9

33 files changed

+45
-44
lines changed

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ group :test do
2121
gem 'puppet-lint-unquoted_string-check', :require => false
2222
gem 'puppet-lint-variable_contains_upcase', :require => false
2323
gem 'puppet-lint-absolute_classname-check', :require => false
24+
gem 'puppet-lint-topscope-variable-check', :require => false, :git => 'https://github.com/mmerfort/puppet-lint-topscope-variable-check.git'
2425
gem 'metadata-json-lint', :require => false
2526
gem 'redcarpet', :require => false
2627
gem 'rubocop', '~> 0.49.1', :require => false

manifests/plugin.pp

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
include collectd
1313

14-
$conf_dir = $::collectd::plugin_conf_dir
15-
$config_group = $::collectd::config_group
14+
$conf_dir = $collectd::plugin_conf_dir
15+
$config_group = $collectd::config_group
1616

1717
$plugin_package = "collectd-${plugin}"
1818
$flush_require = defined(Package[$plugin_package]) ? {
@@ -55,7 +55,7 @@
5555
if ($plugin in $collectd::package_configs) {
5656
file { "package_${plugin}.load":
5757
ensure => absent,
58-
path => "${conf_dir}/${::collectd::package_configs[$plugin]}",
58+
path => "${conf_dir}/${collectd::package_configs[$plugin]}",
5959
notify => Service[$collectd::service_name],
6060
require => $flush_require,
6161
}

manifests/plugin/cuda.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
) {
2020
include collectd
2121

22-
$_manage_package = pick($manage_package, $::collectd::manage_package)
22+
$_manage_package = pick($manage_package, $collectd::manage_package)
2323

2424
if ($_manage_package) {
2525
if (!defined(Package['python-pip'])) {

manifests/plugin/curl.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
include collectd
1010

11-
$_manage_package = pick($manage_package, $::collectd::manage_package)
11+
$_manage_package = pick($manage_package, $collectd::manage_package)
1212

1313
if $facts['os']['family'] == 'RedHat' {
1414
if $_manage_package {

manifests/plugin/curl_json.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
include collectd
2323

24-
$_manage_package = pick($manage_package, $::collectd::manage_package)
24+
$_manage_package = pick($manage_package, $collectd::manage_package)
2525

2626
if $_manage_package {
2727
if $facts['os']['family'] == 'Debian' {

manifests/plugin/dbi.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
include collectd
1212

13-
$_manage_package = pick($manage_package, $::collectd::manage_package)
13+
$_manage_package = pick($manage_package, $collectd::manage_package)
1414

1515
$_databases_defaults = {
1616
'ensure' => $ensure,

manifests/plugin/disk.pp

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
if $manage_package != undef {
1717
$_manage_package = $manage_package
1818
} else {
19-
if versioncmp($::collectd::collectd_version_real, '5.5') >= 0 {
19+
if versioncmp($collectd::collectd_version_real, '5.5') >= 0 {
2020
$_manage_package = true
2121
} else {
2222
$_manage_package = false
2323
}
2424
}
2525

2626
if $ensure == 'present' {
27-
$ensure_real = $::collectd::package_ensure
27+
$ensure_real = $collectd::package_ensure
2828
} elsif $ensure == 'absent' {
2929
$ensure_real = 'absent'
3030
}

manifests/plugin/dns.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
include collectd
1414

15-
$_manage_package = pick($manage_package, $::collectd::manage_package)
15+
$_manage_package = pick($manage_package, $collectd::manage_package)
1616

1717
if $_manage_package {
1818
package { 'collectd-dns':

manifests/plugin/genericjmx.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
$class_path = "${collectd::java_dir}/collectd-api.jar:${collectd::java_dir}/generic-jmx.jar"
1212
$config_file = "${collectd::plugin_conf_dir}/15-genericjmx.conf"
1313

14-
$_manage_package = pick($manage_package, $::collectd::manage_package)
14+
$_manage_package = pick($manage_package, $collectd::manage_package)
1515

1616
if $facts['os']['family'] == 'RedHat' {
1717
if $_manage_package {

manifests/plugin/ipmi.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
include collectd
1515

16-
$manage_package_real = pick($manage_package, $::collectd::manage_package)
16+
$manage_package_real = pick($manage_package, $collectd::manage_package)
1717

1818
if $facts['os']['family'] == 'RedHat' {
1919
if $manage_package_real {

manifests/plugin/iptables.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
include collectd
1212

13-
$_manage_package = pick($manage_package, $::collectd::manage_package)
13+
$_manage_package = pick($manage_package, $collectd::manage_package)
1414

1515
if $facts['os']['family'] == 'RedHat' {
1616
if $_manage_package {

manifests/plugin/iscdhcp.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
) {
1919
include collectd
2020

21-
$_manage_package = pick($manage_package, $::collectd::manage_package)
21+
$_manage_package = pick($manage_package, $collectd::manage_package)
2222

2323
if ($_manage_package) {
2424
if (!defined(Package['python-pip'])) {

manifests/plugin/java.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
include collectd
1212

13-
$_manage_package = pick($manage_package, $::collectd::manage_package)
13+
$_manage_package = pick($manage_package, $collectd::manage_package)
1414

1515
if $facts['os']['family'] == 'RedHat' {
1616
if $_manage_package {

manifests/plugin/lvm.pp

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
include collectd
99

10-
$_manage_package = pick($manage_package, $::collectd::manage_package)
10+
$_manage_package = pick($manage_package, $collectd::manage_package)
1111

1212
if $ensure == 'present' {
13-
$ensure_real = $::collectd::package_ensure
13+
$ensure_real = $collectd::package_ensure
1414
} elsif $ensure == 'absent' {
1515
$ensure_real = 'absent'
1616
}

manifests/plugin/mysql.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
include collectd
1010

11-
$_manage_package = pick($manage_package, $::collectd::manage_package)
11+
$_manage_package = pick($manage_package, $collectd::manage_package)
1212

1313
if $facts['os']['family'] == 'RedHat' {
1414
if $_manage_package {

manifests/plugin/netlink.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
include collectd
1515

16-
$_manage_package = pick($manage_package, $::collectd::manage_package)
16+
$_manage_package = pick($manage_package, $collectd::manage_package)
1717

1818
if $facts['os']['family'] == 'RedHat' {
1919
if $_manage_package {

manifests/plugin/nginx.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
include collectd
1515

16-
$_manage_package = pick($manage_package, $::collectd::manage_package)
16+
$_manage_package = pick($manage_package, $collectd::manage_package)
1717

1818
if $facts['os']['family'] == 'RedHat' {
1919
if $_manage_package {

manifests/plugin/perl.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
include collectd
1010

11-
$_manage_package = pick($manage_package, $::collectd::manage_package)
11+
$_manage_package = pick($manage_package, $collectd::manage_package)
1212

1313
$conf_dir = $collectd::plugin_conf_dir
1414

manifests/plugin/ping.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
include collectd
1616

17-
$_manage_package = pick($manage_package, $::collectd::manage_package)
17+
$_manage_package = pick($manage_package, $collectd::manage_package)
1818

1919
if $facts['os']['family'] == 'RedHat' {
2020
if $_manage_package {

manifests/plugin/postgresql.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
include collectd
1212

13-
$_manage_package = pick($manage_package, $::collectd::manage_package)
13+
$_manage_package = pick($manage_package, $collectd::manage_package)
1414
$databases_defaults = { 'ensure' => $ensure }
1515
$queries_defaults = { 'ensure' => $ensure }
1616
$writers_defaults = { 'ensure' => $ensure }

manifests/plugin/python.pp

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
false => $modulepaths
2525
}
2626

27-
$_manage_package = pick($manage_package, $::collectd::manage_package)
27+
$_manage_package = pick($manage_package, $collectd::manage_package)
2828

2929
if $ensure == 'present' {
30-
$ensure_real = $::collectd::package_ensure
30+
$ensure_real = $collectd::package_ensure
3131
} elsif $ensure == 'absent' {
3232
$ensure_real = 'absent'
3333
}
@@ -57,7 +57,7 @@
5757
'ensure' => $ensure_modulepath,
5858
'mode' => $collectd::plugin_conf_dir_mode,
5959
'owner' => $collectd::config_owner,
60-
'purge' => $::collectd::purge_config,
60+
'purge' => $collectd::purge_config,
6161
'force' => true,
6262
'group' => $collectd::config_group,
6363
'require' => Package[$collectd::package_name]

manifests/plugin/rabbitmq.pp

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
}
7272

7373
$_real_custom_types_db = pick($custom_types_db, $_custom_types_db)
74-
$_manage_package = pick($manage_package, $::collectd::manage_package)
74+
$_manage_package = pick($manage_package, $collectd::manage_package)
7575

7676
if ($_manage_package) {
7777
if (!defined(Package['python-pip'])) {
@@ -107,7 +107,7 @@
107107

108108
file { 'rabbitmq.load':
109109
ensure => $ensure,
110-
path => "${::collectd::plugin_conf_dir}/10-rabbitmq.conf",
110+
path => "${collectd::plugin_conf_dir}/10-rabbitmq.conf",
111111
owner => $collectd::config_owner,
112112
group => $collectd::config_group,
113113
mode => $collectd::config_mode,

manifests/plugin/redis.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
include collectd
2222

23-
$_manage_package = pick($manage_package, $::collectd::manage_package)
23+
$_manage_package = pick($manage_package, $collectd::manage_package)
2424

2525
if $facts['os']['family'] == 'RedHat' {
2626
if $_manage_package {

manifests/plugin/rrdcached.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
include collectd
1919

20-
$_manage_package = pick($manage_package, $::collectd::manage_package)
20+
$_manage_package = pick($manage_package, $collectd::manage_package)
2121

2222
if $facts['os']['family'] == 'RedHat' {
2323
if $_manage_package {

manifests/plugin/rrdtool.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
include collectd
1717

18-
$_manage_package = pick($manage_package, $::collectd::manage_package)
18+
$_manage_package = pick($manage_package, $collectd::manage_package)
1919

2020
if $facts['os']['family'] == 'RedHat' {
2121
if $_manage_package {

manifests/plugin/sensors.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
include collectd
1313

14-
$_manage_package = pick($manage_package, $::collectd::manage_package)
14+
$_manage_package = pick($manage_package, $collectd::manage_package)
1515

1616
if $facts['os']['family'] == 'RedHat' {
1717
if $_manage_package {

manifests/plugin/smart.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
if $manage_package != undef {
1515
$_manage_package = $manage_package
1616
} else {
17-
if versioncmp($::collectd::collectd_version_real, '5.5') >= 0 {
17+
if versioncmp($collectd::collectd_version_real, '5.5') >= 0 {
1818
$_manage_package = true
1919
} else {
2020
$_manage_package = false

manifests/plugin/snmp.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
include collectd
1111

12-
$_manage_package = pick($manage_package, $::collectd::manage_package)
12+
$_manage_package = pick($manage_package, $collectd::manage_package)
1313

1414
if $facts['os']['family'] == 'RedHat' {
1515
if $_manage_package {

manifests/plugin/varnish.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
include collectd
1313

14-
$_manage_package = pick($manage_package, $::collectd::manage_package)
14+
$_manage_package = pick($manage_package, $collectd::manage_package)
1515

1616
if $facts['os']['family'] == 'RedHat' {
1717
if $_manage_package {

manifests/plugin/virt.pp

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
include collectd
1818

19-
$_manage_package = pick($manage_package, $::collectd::manage_package)
19+
$_manage_package = pick($manage_package, $collectd::manage_package)
2020

2121
if $facts['os']['family'] == 'RedHat' {
2222
if $_manage_package {
@@ -26,7 +26,7 @@
2626
}
2727
}
2828

29-
if versioncmp("${::collectd::collectd_version_real}", '5.5') >= 0 { # lint:ignore:only_variable_string
29+
if versioncmp("${collectd::collectd_version_real}", '5.5') >= 0 { # lint:ignore:only_variable_string
3030
$plugin_name = 'virt'
3131
} else {
3232
$plugin_name = 'libvirt'

manifests/plugin/write_sensu.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
include collectd
1616

17-
$_manage_package = pick($manage_package, $::collectd::manage_package)
17+
$_manage_package = pick($manage_package, $collectd::manage_package)
1818

1919
if $facts['os']['family'] == 'RedHat' {
2020
if $_manage_package {

manifests/repo/debian.pp

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
contain apt
44

5-
if $::collectd::ci_package_repo {
5+
if $collectd::ci_package_repo {
66

77
apt::source { 'collectd-ci':
88
location => 'https://pkg.ci.collectd.org/deb/',
9-
repos => "collectd-${$::collectd::ci_package_repo}",
9+
repos => "collectd-${$collectd::ci_package_repo}",
1010
key => {
1111
'id' => 'F806817DC3F5EA417F9FA2963994D24FB8543576',
12-
'server' => $::collectd::package_keyserver,
12+
'server' => $collectd::package_keyserver,
1313
},
1414
}
1515
} else {
@@ -22,7 +22,7 @@
2222
repos => 'main',
2323
key => {
2424
'id' => '7543C08D555DC473B9270ACDAF7ECBB3476ACEB3',
25-
'server' => $::collectd::package_keyserver,
25+
'server' => $collectd::package_keyserver,
2626
},
2727
}
2828
}

manifests/repo/redhat.pp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
class collectd::repo::redhat {
22

3-
if $::collectd::ci_package_repo {
3+
if $collectd::ci_package_repo {
44

55
yumrepo { 'collectd-ci':
66
ensure => present,
77
enabled => '1',
8-
baseurl => "https://pkg.ci.collectd.org/rpm/collectd-${::collectd::ci_package_repo}/epel-${::operatingsystemmajrelease}-${::architecture}",
8+
baseurl => "https://pkg.ci.collectd.org/rpm/collectd-${collectd::ci_package_repo}/epel-${facts['os']['release']['major']}-${facts['architecture']}",
99
gpgkey => 'https://pkg.ci.collectd.org/pubkey.asc',
1010
}
1111

0 commit comments

Comments
 (0)