Skip to content

Commit 2dd0c7d

Browse files
Merge pull request #209 from tuxmea/lint_plugins
enable lint plugins
2 parents ed41d59 + 70aa07d commit 2dd0c7d

12 files changed

Lines changed: 276 additions & 182 deletions

File tree

Gemfile

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,74 @@ if puppetversion = ENV['PUPPET_GEM_VERSION']
3535
else
3636
gem 'puppet', '< 4', :require => false
3737
end
38+
39+
# puppet lint plugins
40+
# https://puppet.community/plugins/#puppet-lint
41+
gem 'puppet-lint-appends-check',
42+
:git => 'https://github.com/puppet-community/puppet-lint-appends-check.git',
43+
:require => false
44+
gem 'puppet-lint-classes_and_types_beginning_with_digits--check',
45+
:git => 'https://github.com/puppet-community/puppet-lint-classes_and_types_beginning_with_digits-check.git',
46+
:require => false
47+
gem 'puppet-lint-empty_string-check',
48+
:git => 'https://github.com/puppet-community/puppet-lint-empty_string-check.git',
49+
:require => false
50+
gem 'puppet-lint-file_ensure-check',
51+
:git => 'https://github.com/puppet-community/puppet-lint-file_ensure-check.git',
52+
:require => false
53+
gem 'puppet-lint-leading_zero-check',
54+
:git => 'https://github.com/puppet-community/puppet-lint-leading_zero-check.git',
55+
:require => false
56+
gem 'puppet-lint-numericvariable',
57+
:git => 'https://github.com/fiddyspence/puppetlint-numericvariable.git',
58+
:require => false
59+
gem 'puppet-lint-resource_reference_syntax',
60+
:git => 'https://github.com/tuxmea/puppet-lint-resource_reference_syntax.git',
61+
:require => false
62+
gem 'puppet-lint-security-plugins',
63+
:git => 'https://github.com/floek/puppet-lint-security-plugins.git',
64+
:require => false
65+
gem 'puppet-lint-spaceship_operator_without_tag-check',
66+
:git => 'https://github.com/puppet-community/puppet-lint-spaceship_operator_without_tag-check.git',
67+
:require => false
68+
gem 'puppet-lint-strict_indent-check',
69+
:git => 'https://github.com/relud/puppet-lint-strict_indent-check.git',
70+
:require => false
71+
gem 'puppet-lint-trailing_comma-check',
72+
:git => 'https://github.com/puppet-community/puppet-lint-trailing_comma-check.git',
73+
:require => false
74+
gem 'puppet-lint-trailing_newline-check',
75+
:git => 'https://github.com/rodjek/puppet-lint-trailing_newline-check.git',
76+
:require => false
77+
gem 'puppet-lint-undef_in_function-check',
78+
:git => 'https://github.com/puppet-community/puppet-lint-undef_in_function-check.git',
79+
:require => false
80+
gem 'puppet-lint-unquoted_string-check',
81+
:git => 'https://github.com/puppet-community/puppet-lint-unquoted_string-check.git',
82+
:require => false
83+
gem 'puppet-lint-usascii_format-check',
84+
:git => 'https://github.com/jpmasters/puppet-lint-usascii_format-check.git',
85+
:require => false
86+
gem 'puppet-lint-variable_contains_upcase',
87+
:git => 'https://github.com/fiddyspence/puppetlint-variablecase.git',
88+
:require => false
89+
gem 'puppet-lint-version_comparison-check',
90+
:git => 'https://github.com/puppet-community/puppet-lint-version_comparison-check.git',
91+
:require => false
92+
93+
# disabled lint plugins
94+
#gem 'puppet-lint-file_source_rights-check',
95+
# :git => 'https://github.com/camptocamp/puppet-lint-file_source_rights-check.git',
96+
# :require => false
97+
#gem 'puppet-lint-fileserver-check',
98+
# :git => 'https://github.com/camptocamp/puppet-lint-fileserver-check.git',
99+
# :require => false
100+
#gem 'puppet-lint-global_resource-check',
101+
# :git => 'https://github.com/ninech/puppet-lint-global_resource-check.git',
102+
# :require => false
103+
#gem 'puppet-lint-package_ensure-check',
104+
# :git => 'https://github.com/danzilio/puppet-lint-package_ensure-check.git',
105+
# :require => false
106+
#gem 'puppet-lint-param-docs',
107+
# :git => 'https://github.com/domcleal/puppet-lint-param-docs.git',
108+
# :require => false

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ PuppetLint::RakeTask.new(:lint) do |config|
2727
#config.ignore_paths = ['vendor/**/*.pp']
2828

2929
# List of checks to disable
30-
config.disable_checks = ['80chars']
30+
config.disable_checks = ['80chars', 'class_inherits_from_params_class']
3131

3232
# Should the task fail if there were any warnings, defaults to false
3333
#config.fail_on_warnings = true

manifests/compute_node/config.pp

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,31 @@
3737
validate_string ($debian_mirror_url)
3838
validate_hash ($preseed_data)
3939

40+
$_polkit_file_path = $::osfamily ? {
41+
'RedHat' => '/etc/polkit-1/localauthority/50-local.d/50-org.libvirt.unix.manage-opennebula.pkla',
42+
'Debian' => '/var/lib/polkit-1/localauthority/50-local.d/50-org.libvirt.unix.manage-opennebula.pkla',
43+
}
44+
4045
file { '/etc/libvirt/libvirtd.conf':
4146
ensure => file,
4247
source => 'puppet:///modules/one/libvirtd.conf',
48+
owner => 'root',
49+
group => 'root',
4350
notify => Service[$libvirtd_srv],
4451
} ->
4552

4653
file { $libvirtd_cfg:
4754
ensure => file,
4855
source => $libvirtd_source,
56+
owner => 'root',
57+
group => 'root',
4958
notify => Service[$libvirtd_srv],
5059
} ->
5160

5261
file { '/etc/udev/rules.d/80-kvm.rules':
5362
ensure => file,
63+
owner => 'root',
64+
group => 'root',
5465
source => 'puppet:///modules/one/udev-kvm-rules',
5566
} ->
5667

@@ -72,16 +83,17 @@
7283

7384
file { 'polkit-opennebula':
7485
ensure => file,
75-
path => $::osfamily ? {
76-
'RedHat' => '/etc/polkit-1/localauthority/50-local.d/50-org.libvirt.unix.manage-opennebula.pkla',
77-
'Debian' => '/var/lib/polkit-1/localauthority/50-local.d/50-org.libvirt.unix.manage-opennebula.pkla',
78-
},
86+
path => $_polkit_file_path,
87+
owner => 'root',
88+
group => 'root',
7989
source => 'puppet:///modules/one/50-org.libvirt.unix.manage-opennebula.pkla',
8090
} ->
8191

8292
file { '/etc/libvirt/qemu.conf':
8393
ensure => file,
84-
source => 'puppet:///modules/one/qemu.conf'
94+
owner => 'root',
95+
group => 'root',
96+
source => 'puppet:///modules/one/qemu.conf',
8597
} ->
8698

8799
file { '/var/lib/one/.virtinst':
@@ -105,8 +117,7 @@
105117
mode => '0771',
106118
} ->
107119

108-
file { ['/var/lib/one/etc/kickstart.d',
109-
'/var/lib/one/etc/preseed.d']:
120+
file { ['/var/lib/one/etc/kickstart.d', '/var/lib/one/etc/preseed.d']:
110121
ensure => directory,
111122
owner => 'oneadmin',
112123
group => 'oneadmin',
@@ -128,6 +139,8 @@
128139
file { '/sbin/brctl':
129140
ensure => link,
130141
target => '/usr/sbin/brctl',
142+
owner => 'root',
143+
group => 'root',
131144
}
132145
}
133146

manifests/compute_node/install.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
$node_packages = $one::node_packages
2222
) {
2323
package { $node_packages:
24-
ensure => latest,
24+
ensure => latest,
2525
}
2626
}

manifests/compute_node/service.pp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@
2525
enable => true,
2626
}
2727
case $::osfamily {
28-
'RedHat': {
29-
service { 'ksmtuned':
30-
ensure => stopped,
31-
enable => false,
32-
hasstatus => true,
33-
}
34-
service { 'ksm':
35-
ensure => running,
36-
enable => true,
37-
hasstatus => true,
38-
}
28+
'RedHat': {
29+
service { 'ksmtuned':
30+
ensure => stopped,
31+
enable => false,
32+
hasstatus => true,
3933
}
40-
default: {
41-
notice('we need to check how to enable ksm.')
34+
service { 'ksm':
35+
ensure => running,
36+
enable => true,
37+
hasstatus => true,
4238
}
39+
}
40+
default: {
41+
notice('we need to check how to enable ksm.')
42+
}
4343
}
4444
}

0 commit comments

Comments
 (0)