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. This commit also remove custom metadata rake task (this task is now provided by puppetlabs_spec_helper). Conflicts: Gemfile Change-Id: I22369948db6a2f8ddab9b8c93c3a047ff2e229ca
This commit is contained in:
parent
55b7aad8cf
commit
565c78cc7f
15
Gemfile
15
Gemfile
@ -2,9 +2,20 @@ source 'https://rubygems.org'
|
||||
|
||||
group :development, :test do
|
||||
gem 'puppetlabs_spec_helper', :require => false
|
||||
gem 'rspec-puppet', '~> 2.0.0'
|
||||
gem 'puppet-lint-param-docs'
|
||||
gem 'rspec-puppet', '~> 2.0.0', :require => false
|
||||
|
||||
gem 'metadata-json-lint'
|
||||
gem 'puppet-lint-param-docs'
|
||||
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 'json'
|
||||
gem 'webmock'
|
||||
end
|
||||
|
5
Rakefile
5
Rakefile
@ -10,8 +10,3 @@ PuppetLint.configuration.send('disable_only_variable_string')
|
||||
exclude_tests_paths = ['pkg/**/*','vendor/**/*']
|
||||
PuppetLint.configuration.ignore_paths = exclude_tests_paths
|
||||
PuppetSyntax.exclude_paths = exclude_tests_paths
|
||||
|
||||
desc "Lint metadata.json file"
|
||||
task :metadata do
|
||||
sh "metadata-json-lint metadata.json"
|
||||
end
|
||||
|
@ -4,39 +4,39 @@ node default {
|
||||
}
|
||||
|
||||
# First, install a mysql server
|
||||
class { 'mysql::server': }
|
||||
class { '::mysql::server': }
|
||||
# And create the database
|
||||
class { 'ceilometer::db::mysql':
|
||||
class { '::ceilometer::db::mysql':
|
||||
password => 'ceilometer',
|
||||
}
|
||||
|
||||
# Add the base ceilometer class & parameters
|
||||
# This class is required by ceilometer agents & api classes
|
||||
# The metering_secret parameter is mandatory
|
||||
class { 'ceilometer':
|
||||
class { '::ceilometer':
|
||||
metering_secret => 'darksecret'
|
||||
}
|
||||
|
||||
# Configure the ceilometer database
|
||||
# Only needed if ceilometer::agent::central or ceilometer::api are declared
|
||||
class { 'ceilometer::db':
|
||||
class { '::ceilometer::db':
|
||||
}
|
||||
|
||||
# Configure ceilometer database with mongodb
|
||||
|
||||
# class { 'ceilometer::db':
|
||||
# class { '::ceilometer::db':
|
||||
# database_connection => 'mongodb://localhost:27017/ceilometer',
|
||||
# require => Class['mongodb'],
|
||||
# }
|
||||
|
||||
# Install the ceilometer-api service
|
||||
# The keystone_password parameter is mandatory
|
||||
class { 'ceilometer::api':
|
||||
class { '::ceilometer::api':
|
||||
keystone_password => 'tralalayouyou'
|
||||
}
|
||||
|
||||
# Set common auth parameters used by all agents (compute/central)
|
||||
class { 'ceilometer::agent::auth':
|
||||
class { '::ceilometer::agent::auth':
|
||||
auth_url => 'http://localhost:35357/v2.0',
|
||||
auth_password => 'tralalerotralala'
|
||||
}
|
||||
@ -59,7 +59,7 @@ node default {
|
||||
# ipmi_namespace => true
|
||||
# }
|
||||
# As default use central and compute polling namespaces
|
||||
class { 'ceilometer::agent::polling':
|
||||
class { '::ceilometer::agent::polling':
|
||||
central_namespace => true,
|
||||
compute_namespace => true,
|
||||
ipmi_namespace => false,
|
||||
@ -75,20 +75,20 @@ node default {
|
||||
# }
|
||||
|
||||
# Install alarm notifier
|
||||
class { 'ceilometer::alarm::notifier':
|
||||
class { '::ceilometer::alarm::notifier':
|
||||
}
|
||||
|
||||
# Install alarm evaluator
|
||||
class { 'ceilometer::alarm::evaluator':
|
||||
class { '::ceilometer::alarm::evaluator':
|
||||
}
|
||||
|
||||
# Purge 1 month old meters
|
||||
class { 'ceilometer::expirer':
|
||||
class { '::ceilometer::expirer':
|
||||
time_to_live => '2592000'
|
||||
}
|
||||
|
||||
# Install notification agent
|
||||
class { 'ceilometer::agent::notification':
|
||||
class { '::ceilometer::agent::notification':
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ class ceilometer::agent::central (
|
||||
$coordination_url = undef,
|
||||
) {
|
||||
|
||||
include ceilometer::params
|
||||
include ::ceilometer::params
|
||||
|
||||
Ceilometer_config<||> ~> Service['ceilometer-agent-central']
|
||||
|
||||
|
@ -22,7 +22,7 @@ class ceilometer::agent::compute (
|
||||
|
||||
warning('This class is deprecated. Please use ceilometer::agent::polling with compute namespace instead.')
|
||||
|
||||
include ceilometer::params
|
||||
include ::ceilometer::params
|
||||
|
||||
Ceilometer_config<||> ~> Service['ceilometer-agent-compute']
|
||||
|
||||
|
@ -52,7 +52,7 @@ class ceilometer::agent::notification (
|
||||
$package_ensure = 'present',
|
||||
) {
|
||||
|
||||
include ceilometer::params
|
||||
include ::ceilometer::params
|
||||
|
||||
Ceilometer_config<||> ~> Service['ceilometer-agent-notification']
|
||||
|
||||
|
@ -40,7 +40,7 @@ class ceilometer::agent::polling (
|
||||
$coordination_url = undef,
|
||||
) inherits ceilometer {
|
||||
|
||||
include ceilometer::params
|
||||
include ::ceilometer::params
|
||||
|
||||
if $central_namespace {
|
||||
$central_namespace_name = 'central'
|
||||
|
@ -39,7 +39,7 @@ class ceilometer::alarm::evaluator (
|
||||
$coordination_url = undef,
|
||||
) {
|
||||
|
||||
include ceilometer::params
|
||||
include ::ceilometer::params
|
||||
|
||||
validate_re("${evaluation_interval}",'^(\d+)$')
|
||||
|
||||
|
@ -34,7 +34,7 @@ class ceilometer::alarm::notifier (
|
||||
$rest_notifier_ssl_verify = true,
|
||||
) {
|
||||
|
||||
include ceilometer::params
|
||||
include ::ceilometer::params
|
||||
|
||||
validate_bool($rest_notifier_ssl_verify)
|
||||
|
||||
|
@ -76,8 +76,8 @@ class ceilometer::api (
|
||||
$port = '8777'
|
||||
) {
|
||||
|
||||
include ceilometer::params
|
||||
include ceilometer::policy
|
||||
include ::ceilometer::params
|
||||
include ::ceilometer::policy
|
||||
|
||||
validate_string($keystone_password)
|
||||
|
||||
|
@ -9,7 +9,7 @@ class ceilometer::client (
|
||||
$ensure = 'present'
|
||||
) {
|
||||
|
||||
include ceilometer::params
|
||||
include ::ceilometer::params
|
||||
|
||||
package { 'python-ceilometerclient':
|
||||
ensure => $ensure,
|
||||
|
@ -19,7 +19,7 @@ class ceilometer::collector (
|
||||
$package_ensure = 'present',
|
||||
) {
|
||||
|
||||
include ceilometer::params
|
||||
include ::ceilometer::params
|
||||
|
||||
Ceilometer_config<||> ~> Service['ceilometer-collector']
|
||||
|
||||
|
@ -18,7 +18,7 @@ class ceilometer::db (
|
||||
$mysql_module = undef,
|
||||
) {
|
||||
|
||||
include ceilometer::params
|
||||
include ::ceilometer::params
|
||||
|
||||
if $mysql_module {
|
||||
warning('The mysql_module parameter is deprecated. The latest 2.x mysql module will be used.')
|
||||
@ -33,7 +33,7 @@ class ceilometer::db (
|
||||
/^mysql:\/\//: {
|
||||
$backend_package = false
|
||||
|
||||
include mysql::bindings::python
|
||||
include ::mysql::bindings::python
|
||||
}
|
||||
/^postgresql:\/\//: {
|
||||
$backend_package = $::ceilometer::params::psycopg_package_name
|
||||
|
@ -51,7 +51,7 @@ class ceilometer::expirer (
|
||||
$weekday = '*',
|
||||
) {
|
||||
|
||||
include ceilometer::params
|
||||
include ::ceilometer::params
|
||||
|
||||
Package<| title == 'ceilometer-common' |> -> Class['ceilometer::expirer']
|
||||
|
||||
|
@ -112,7 +112,7 @@ class ceilometer(
|
||||
|
||||
validate_string($metering_secret)
|
||||
|
||||
include ceilometer::params
|
||||
include ::ceilometer::params
|
||||
|
||||
if $kombu_ssl_ca_certs and !$rabbit_use_ssl {
|
||||
fail('The kombu_ssl_ca_certs parameter requires rabbit_use_ssl to be set to true')
|
||||
|
@ -125,7 +125,7 @@ class ceilometer::keystone::auth (
|
||||
$real_service_name = $auth_name
|
||||
}
|
||||
|
||||
keystone::resource::service_identity { $auth_name:
|
||||
::keystone::resource::service_identity { $auth_name:
|
||||
configure_user => $configure_user,
|
||||
configure_user_role => $configure_user_role,
|
||||
configure_endpoint => $configure_endpoint,
|
||||
|
@ -102,7 +102,7 @@ class ceilometer::wsgi::apache (
|
||||
include ::apache::mod::ssl
|
||||
}
|
||||
|
||||
openstacklib::wsgi::apache { 'ceilometer_wsgi':
|
||||
::openstacklib::wsgi::apache { 'ceilometer_wsgi':
|
||||
bind_host => $bind_host,
|
||||
bind_port => $port,
|
||||
group => 'ceilometer',
|
||||
|
Loading…
Reference in New Issue
Block a user