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

12
Gemfile
View File

@@ -2,7 +2,17 @@ source 'https://rubygems.org'
group :development, :test do group :development, :test do
gem 'puppetlabs_spec_helper', :require => false gem 'puppetlabs_spec_helper', :require => false
gem 'puppet-lint', '~> 0.3.2' 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 'rake', '10.1.1'
gem 'rspec-puppet', '~> 1.0.1', :require => false gem 'rspec-puppet', '~> 1.0.1', :require => false
gem 'beaker-rspec', '~> 2.2.4', :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_api_service with nova_vip
# sudo pcs constraint colocation add nova_novncproxy_service with nova_vip # sudo pcs constraint colocation add nova_novncproxy_service with nova_vip
class { 'nova': } class { '::nova': }
class { 'nova::api': class { '::nova::api':
enabled => false, enabled => false,
manage_service => false, manage_service => false,
admin_password => 'PASSWORD', admin_password => 'PASSWORD',
} }
class { 'nova::conductor': class { '::nova::conductor':
enabled => false, enabled => false,
manage_service => false, manage_service => false,
} }
class { 'nova::consoleauth': class { '::nova::consoleauth':
enabled => false, enabled => false,
manage_service => false, manage_service => false,
} }
class { 'nova::scheduler': class { '::nova::scheduler':
enabled => false, enabled => false,
manage_service => false, manage_service => false,
} }
class { 'nova::vncproxy': class { '::nova::vncproxy':
enabled => false, enabled => false,
manage_service => false, manage_service => false,
} }

View File

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

View File

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

View File

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

View File

@@ -133,7 +133,7 @@ class nova::compute (
$pci_passthrough = undef, $pci_passthrough = undef,
) { ) {
include nova::params include ::nova::params
nova_config { nova_config {
'DEFAULT/reserved_host_memory_mb': value => $reserved_host_memory; '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, $libvirt_service_name = $::nova::params::libvirt_service_name,
) inherits nova::params { ) inherits nova::params {
include nova::params include ::nova::params
Service['libvirt'] -> Service['nova-compute'] Service['libvirt'] -> Service['nova-compute']
@@ -135,7 +135,7 @@ class nova::compute::libvirt (
if $vncserver_listen != '0.0.0.0' { if $vncserver_listen != '0.0.0.0' {
fail('For migration support to work, you MUST set vncserver_listen to \'0.0.0.0\'') fail('For migration support to work, you MUST set vncserver_listen to \'0.0.0.0\'')
} else { } else {
class { 'nova::migration::libvirt': } class { '::nova::migration::libvirt': }
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -70,7 +70,7 @@ class nova::network(
$install_service = true $install_service = true
) { ) {
include nova::params include ::nova::params
# forward all ipv4 traffic # forward all ipv4 traffic
# this is required for the vms to pass through the gateways # this is required for the vms to pass through the gateways

View File

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

View File

@@ -50,7 +50,7 @@ class nova::qpid(
$service_ensure = 'stopped' $service_ensure = 'stopped'
} }
class { 'qpid::server': class { '::qpid::server':
service_ensure => $service_ensure service_ensure => $service_ensure
} }

View File

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

View File

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

View File

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

View File

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