Add Puppet 4.x lint checks

This changes the puppet-lint requirement to 1.1.x, so that we can use
puppet-lint plugins.  Most of these plugins are for 4.x compat, but some
just catch common errors.

Change-Id: I48838fa11902247101c0473abff65cbb2558f609
This commit is contained in:
Clayton O'Neill 2015-02-16 10:01:53 -05:00
parent 2d1b72b01d
commit 00e744a9b1
22 changed files with 69 additions and 59 deletions

14
Gemfile
View File

@ -1,8 +1,18 @@
source 'https://rubygems.org'
group :development, :test do
gem 'puppetlabs_spec_helper', :require => false
gem 'puppet-lint', '~> 0.3.2'
gem 'puppetlabs_spec_helper', :require => false
gem 'puppet-lint', '~> 1.1.0'
gem 'puppet-lint-absolute_classname-check'
gem 'puppet-lint-absolute_template_path'
gem 'puppet-lint-trailing_newline-check'
# Puppet 4.x related lint checks
gem 'puppet-lint-unquoted_string-check'
gem 'puppet-lint-leading_zero-check'
gem 'puppet-lint-variable_contains_upcase'
gem 'puppet-lint-numericvariable'
gem 'rake', '10.1.1'
gem 'rspec-puppet', '~> 1.0.1', :require => false
gem 'beaker-rspec', '~> 2.2.4', :require => false

View File

@ -25,30 +25,30 @@
# sudo pcs constraint colocation add nova_api_service with nova_vip
# sudo pcs constraint colocation add nova_novncproxy_service with nova_vip
class { 'nova': }
class { '::nova': }
class { 'nova::api':
enabled => false,
manage_service => false,
admin_password => 'PASSWORD',
class { '::nova::api':
enabled => false,
manage_service => false,
admin_password => 'PASSWORD',
}
class { 'nova::conductor':
class { '::nova::conductor':
enabled => false,
manage_service => false,
}
class { 'nova::consoleauth':
class { '::nova::consoleauth':
enabled => false,
manage_service => false,
}
class { 'nova::scheduler':
class { '::nova::scheduler':
enabled => false,
manage_service => false,
}
class { 'nova::vncproxy':
class { '::nova::vncproxy':
enabled => false,
manage_service => false,
}

View File

@ -177,11 +177,11 @@ class nova::api(
$conductor_workers = undef,
) {
include nova::db
include nova::params
include nova::policy
require keystone::python
include cinder::client
include ::nova::db
include ::nova::params
include ::nova::policy
require ::keystone::python
include ::cinder::client
Package<| title == 'nova-api' |> -> Nova_paste_api_ini<| |>

View File

@ -166,7 +166,7 @@ class nova::cells (
$weight_scale = '1.0'
) {
include nova::params
include ::nova::params
case $cell_type {
'parent': {

View File

@ -22,7 +22,7 @@ class nova::cert(
$ensure_package = 'present'
) {
include nova::params
include ::nova::params
nova::generic_service { 'cert':
enabled => $enabled,

View File

@ -133,7 +133,7 @@ class nova::compute (
$pci_passthrough = undef,
) {
include nova::params
include ::nova::params
nova_config {
'DEFAULT/reserved_host_memory_mb': value => $reserved_host_memory;

View File

@ -94,7 +94,7 @@ class nova::compute::libvirt (
$libvirt_service_name = $::nova::params::libvirt_service_name,
) inherits nova::params {
include nova::params
include ::nova::params
Service['libvirt'] -> Service['nova-compute']
@ -135,7 +135,7 @@ class nova::compute::libvirt (
if $vncserver_listen != '0.0.0.0' {
fail('For migration support to work, you MUST set vncserver_listen to \'0.0.0.0\'')
} else {
class { 'nova::migration::libvirt': }
class { '::nova::migration::libvirt': }
}
}

View File

@ -51,7 +51,7 @@ class nova::compute::rbd (
$rbd_keyring = 'client.nova',
) {
include nova::params
include ::nova::params
nova_config {
'libvirt/images_type': value => 'rbd';

View File

@ -27,8 +27,8 @@ class nova::conductor(
$workers = undef,
) {
include nova::db
include nova::params
include ::nova::db
include ::nova::params
nova::generic_service { 'conductor':
enabled => $enabled,

View File

@ -25,7 +25,7 @@ class nova::consoleauth(
$ensure_package = 'present'
) {
include nova::params
include ::nova::params
nova::generic_service { 'consoleauth':
enabled => $enabled,

View File

@ -18,7 +18,7 @@ define nova::generic_service(
$ensure_package = 'present'
) {
include nova::params
include ::nova::params
$nova_title = "nova-${name}"
# ensure that the service is only started after

View File

@ -290,7 +290,7 @@ class nova(
) inherits nova::params {
# maintain backward compatibility
include nova::db
include ::nova::db
if $mysql_module {
warning('The mysql_module parameter is deprecated. The latest 2.x mysql module will be used.')
@ -391,7 +391,7 @@ class nova(
}
if $install_utilities {
class { 'nova::utilities': }
class { '::nova::utilities': }
}
# this anchor is used to simplify the graph between nova components by

View File

@ -30,10 +30,10 @@ class nova::migration::libvirt {
}
file_line { '/etc/sysconfig/libvirtd libvirtd args':
path => '/etc/sysconfig/libvirtd',
line => 'LIBVIRTD_ARGS="--listen"',
match => 'LIBVIRTD_ARGS=',
notify => Service['libvirt'],
path => '/etc/sysconfig/libvirtd',
line => 'LIBVIRTD_ARGS="--listen"',
match => 'LIBVIRTD_ARGS=',
notify => Service['libvirt'],
}
Package['libvirt'] -> File_line<| path == '/etc/sysconfig/libvirtd' |>
@ -61,10 +61,10 @@ class nova::migration::libvirt {
notify => Service['libvirt'],
}
file_line { "/etc/default/${::nova::compute::libvirt::libvirt_service_name} libvirtd opts":
path => "/etc/default/${::nova::compute::libvirt::libvirt_service_name}",
line => 'libvirtd_opts="-d -l"',
match => 'libvirtd_opts=',
notify => Service['libvirt'],
path => "/etc/default/${::nova::compute::libvirt::libvirt_service_name}",
line => 'libvirtd_opts="-d -l"',
match => 'libvirtd_opts=',
notify => Service['libvirt'],
}
Package['libvirt'] -> File_line<| path == "/etc/default/${::nova::compute::libvirt::libvirt_service_name}" |>

View File

@ -70,7 +70,7 @@ class nova::network(
$install_service = true
) {
include nova::params
include ::nova::params
# forward all ipv4 traffic
# this is required for the vms to pass through the gateways
@ -103,10 +103,10 @@ class nova::network(
if $create_networks {
nova::manage::network { 'nova-vm-net':
network => $fixed_range,
num_networks => $num_networks,
network_size => $network_size,
vlan_start => $vlan_start,
network => $fixed_range,
num_networks => $num_networks,
network_size => $network_size,
vlan_start => $vlan_start,
}
if $floating_range {
nova::manage::floating { 'nova-vm-floating':

View File

@ -27,7 +27,7 @@ class nova::objectstore(
$bind_address = '0.0.0.0'
) {
include nova::params
include ::nova::params
nova::generic_service { 'objectstore':
enabled => $enabled,

View File

@ -39,18 +39,18 @@ class nova::qpid(
$service_ensure = 'running'
qpid_user { $user:
password => $password,
file => $file,
realm => $realm,
provider => 'saslpasswd2',
require => Class['qpid::server'],
password => $password,
file => $file,
realm => $realm,
provider => 'saslpasswd2',
require => Class['qpid::server'],
}
} else {
$service_ensure = 'stopped'
}
class { 'qpid::server':
class { '::qpid::server':
service_ensure => $service_ensure
}

View File

@ -54,9 +54,9 @@ class nova::rabbitmq(
} else {
$delete_guest_user = true
rabbitmq_user { $userid:
admin => true,
password => $password,
provider => 'rabbitmqctl',
admin => true,
password => $password,
provider => 'rabbitmqctl',
}
# I need to figure out the appropriate permissions
rabbitmq_user_permissions { "${userid}@${virtual_host}":

View File

@ -22,8 +22,8 @@ class nova::scheduler(
$ensure_package = 'present'
) {
include nova::db
include nova::params
include ::nova::db
include ::nova::params
nova::generic_service { 'scheduler':
enabled => $enabled,

View File

@ -32,7 +32,7 @@ class nova::serialproxy(
$ensure_package = 'present'
) {
include nova::params
include ::nova::params
nova_config {
'serial_console/serialproxy_port': value => $serialproxy_port;

View File

@ -36,7 +36,7 @@ class nova::spicehtml5proxy(
$ensure_package = 'present'
) {
include nova::params
include ::nova::params
nova_config {
'DEFAULT/spicehtml5proxy_host': value => $host;

View File

@ -13,9 +13,9 @@ class nova::utilities {
}
file {'guestfs.seed':
ensure => present,
path => '/var/run/guestfs.seed',
content => 'libguestfs0 libguestfs/update-appliance boolean true'
ensure => present,
path => '/var/run/guestfs.seed',
content => 'libguestfs0 libguestfs/update-appliance boolean true'
}
}
}

View File

@ -32,7 +32,7 @@ class nova::vncproxy(
$ensure_package = 'present'
) {
include nova::params
include ::nova::params
# TODO make this work on Fedora