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: I5d8988653943631d5d2179702de1220263b67850 Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
This commit is contained in:
15
Gemfile
15
Gemfile
@@ -2,7 +2,20 @@ source 'https://rubygems.org'
|
||||
|
||||
group :development, :test do
|
||||
gem 'puppetlabs_spec_helper', :require => false
|
||||
gem 'puppet-lint', '~> 0.3.2'
|
||||
|
||||
gem 'puppet-lint', '~> 1.1.0'
|
||||
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 'rspec-puppet', '~> 1.0.1'
|
||||
gem 'rake', '10.1.1'
|
||||
gem 'rspec', '< 2.99'
|
||||
|
5
Rakefile
5
Rakefile
@@ -1,6 +1,11 @@
|
||||
require 'puppetlabs_spec_helper/rake_tasks'
|
||||
require 'puppet-lint/tasks/puppet-lint'
|
||||
require 'puppet-syntax/tasks/puppet-syntax'
|
||||
|
||||
PuppetLint.configuration.fail_on_warnings = true
|
||||
PuppetLint.configuration.send('disable_80chars')
|
||||
PuppetLint.configuration.send('disable_class_parameter_defaults')
|
||||
|
||||
exclude_tests_paths = ['pkg/**/*','vendor/**/*']
|
||||
PuppetLint.configuration.ignore_paths = exclude_tests_paths
|
||||
PuppetSyntax.exclude_paths = exclude_tests_paths
|
||||
|
@@ -155,6 +155,18 @@
|
||||
# Specify an absolute pathname.
|
||||
# Defaults to /tmp
|
||||
#
|
||||
# [*policy_files_path*]
|
||||
# (Optional) The path to the policy files
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*policy_files*]
|
||||
# (Optional) Policy files
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*can_set_mount_point*]
|
||||
# (Optional) DEPRECATED
|
||||
# Defaults to 'undef'.
|
||||
#
|
||||
# [*secure_cookies*]
|
||||
# (optional) Enables security settings for cookies. Useful when using
|
||||
# https on public sites. See: http://docs.openstack.org/developer/horizon/topics/deployment.html#secure-site-recommendations
|
||||
@@ -220,7 +232,7 @@ class horizon(
|
||||
|
||||
$hypervisor_defaults = {
|
||||
'can_set_mount_point' => true,
|
||||
'can_set_password' => false
|
||||
'can_set_password' => false,
|
||||
}
|
||||
|
||||
if $fqdn {
|
||||
@@ -248,14 +260,14 @@ class horizon(
|
||||
'enable_quotas' => true,
|
||||
'enable_security_group' => true,
|
||||
'enable_vpn' => false,
|
||||
'profile_support' => 'None'
|
||||
'profile_support' => 'None',
|
||||
}
|
||||
|
||||
Service <| title == 'memcached' |> -> Class['horizon']
|
||||
|
||||
package { 'horizon':
|
||||
ensure => $package_ensure,
|
||||
name => $::horizon::params::package_name,
|
||||
ensure => $package_ensure,
|
||||
name => $::horizon::params::package_name,
|
||||
}
|
||||
|
||||
concat { $::horizon::params::config_file:
|
||||
@@ -266,7 +278,7 @@ class horizon(
|
||||
concat::fragment { 'local_settings.py':
|
||||
target => $::horizon::params::config_file,
|
||||
content => template($local_settings_template),
|
||||
order => '50'
|
||||
order => '50',
|
||||
}
|
||||
|
||||
package { 'python-lesscpy':
|
||||
@@ -284,7 +296,7 @@ class horizon(
|
||||
}
|
||||
|
||||
if $configure_apache {
|
||||
class { 'horizon::wsgi::apache':
|
||||
class { '::horizon::wsgi::apache':
|
||||
bind_address => $bind_address,
|
||||
servername => $servername,
|
||||
server_aliases => $final_server_aliases,
|
||||
@@ -302,7 +314,7 @@ class horizon(
|
||||
ensure => directory,
|
||||
owner => $::horizon::params::wsgi_user,
|
||||
group => $::horizon::params::wsgi_group,
|
||||
mode => '0755'
|
||||
mode => '0755',
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -4,41 +4,61 @@
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*bind_address*]
|
||||
# (optional) Bind address in Apache for Horizon. (Defaults to '0.0.0.0')
|
||||
# [*bind_address*]
|
||||
# (optional) Bind address in Apache for Horizon. (Defaults to '0.0.0.0')
|
||||
#
|
||||
# [*server_aliases*]
|
||||
# (optional) List of names which should be defined as ServerAlias directives
|
||||
# in vhost.conf.
|
||||
# Defaults to ::fqdn.
|
||||
# [*fqdn*]
|
||||
# (Optional) Fqdn
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*listen_ssl*]
|
||||
# (optional) Enable SSL support in Apache. (Defaults to false)
|
||||
# [*servername*]
|
||||
# (Optional) Server Name
|
||||
# Defaults to ::fqdn.
|
||||
#
|
||||
# [*horizon_cert*]
|
||||
# (required with listen_ssl) Certificate to use for SSL support.
|
||||
# [*ssl_redirect*]
|
||||
# (Optional) Enable SSL Redirect
|
||||
# Defaults to 'true'.
|
||||
#
|
||||
# [*horizon_key*]
|
||||
# (required with listen_ssl) Private key to use for SSL support.
|
||||
# [*server_aliases*]
|
||||
# (optional) List of names which should be defined as ServerAlias directives
|
||||
# in vhost.conf.
|
||||
# Defaults to ::fqdn.
|
||||
#
|
||||
# [*horizon_ca*]
|
||||
# (required with listen_ssl) CA certificate to use for SSL support.
|
||||
# [*listen_ssl*]
|
||||
# (optional) Enable SSL support in Apache. (Defaults to false)
|
||||
#
|
||||
# [*wsgi_processes*]
|
||||
# (optional) Number of Horizon processes to spawn
|
||||
# Defaults to '3'
|
||||
# [*horizon_cert*]
|
||||
# (required with listen_ssl) Certificate to use for SSL support.
|
||||
#
|
||||
# [*wsgi_threads*]
|
||||
# (optional) Number of thread to run in a Horizon process
|
||||
# Defaults to '10'
|
||||
# [*horizon_key*]
|
||||
# (required with listen_ssl) Private key to use for SSL support.
|
||||
#
|
||||
# [*priority*]
|
||||
# (optional) The apache vhost priority.
|
||||
# Defaults to '15'. To set Horizon as the primary vhost, change to '10'.
|
||||
# [*horizon_ca*]
|
||||
# (required with listen_ssl) CA certificate to use for SSL support.
|
||||
#
|
||||
# [*extra_params*]
|
||||
# (optional) A hash of extra paramaters for apache::wsgi class.
|
||||
# Defaults to {}
|
||||
# [*wsgi_processes*]
|
||||
# (optional) Number of Horizon processes to spawn
|
||||
# Defaults to '3'
|
||||
#
|
||||
# [*wsgi_threads*]
|
||||
# (optional) Number of thread to run in a Horizon process
|
||||
# Defaults to '10'
|
||||
#
|
||||
# [*priority*]
|
||||
# (optional) The apache vhost priority.
|
||||
# Defaults to '15'. To set Horizon as the primary vhost, change to '10'.
|
||||
#
|
||||
# [*vhost_conf_name*]
|
||||
# (Optional) Description
|
||||
# Defaults to 'horizon_vhost'.
|
||||
#
|
||||
# [*vhost_ssl_conf_name*]
|
||||
# (Optional) Description
|
||||
# Defaults to 'horizon_ssl_vhost'.
|
||||
#
|
||||
# [*extra_params*]
|
||||
# (optional) A hash of extra paramaters for apache::wsgi class.
|
||||
# Defaults to {}
|
||||
class horizon::wsgi::apache (
|
||||
$bind_address = undef,
|
||||
$fqdn = undef,
|
||||
@@ -81,7 +101,7 @@ class horizon::wsgi::apache (
|
||||
# - ${priority}-${vhost_conf_name}.conf
|
||||
# - ${priority}-${vhost_ssl_conf_name}.conf
|
||||
#",
|
||||
require => Package[$::horizon::params::package_name]
|
||||
require => Package[$::horizon::params::package_name],
|
||||
}
|
||||
|
||||
|
||||
@@ -125,44 +145,45 @@ class horizon::wsgi::apache (
|
||||
}
|
||||
|
||||
file { $::horizon::params::logdir:
|
||||
ensure => directory,
|
||||
owner => $unix_user,
|
||||
group => $unix_group,
|
||||
before => Service[$::horizon::params::http_service],
|
||||
mode => '0751',
|
||||
require => Package['horizon']
|
||||
ensure => directory,
|
||||
owner => $unix_user,
|
||||
group => $unix_group,
|
||||
before => Service[$::horizon::params::http_service],
|
||||
mode => '0751',
|
||||
require => Package['horizon'],
|
||||
}
|
||||
|
||||
file { "${::horizon::params::logdir}/horizon.log":
|
||||
ensure => file,
|
||||
owner => $unix_user,
|
||||
group => $unix_group,
|
||||
before => Service[$::horizon::params::http_service],
|
||||
mode => '0640',
|
||||
require => [ File[$::horizon::params::logdir], Package['horizon'] ],
|
||||
ensure => file,
|
||||
owner => $unix_user,
|
||||
group => $unix_group,
|
||||
before => Service[$::horizon::params::http_service],
|
||||
mode => '0640',
|
||||
require => [ File[$::horizon::params::logdir], Package['horizon'] ],
|
||||
}
|
||||
|
||||
$default_vhost_conf_no_ip = {
|
||||
servername => $servername,
|
||||
serveraliases => os_any2array($final_server_aliases),
|
||||
docroot => '/var/www/',
|
||||
access_log_file => 'horizon_access.log',
|
||||
error_log_file => 'horizon_error.log',
|
||||
priority => $priority,
|
||||
aliases => [
|
||||
{ alias => '/static', path => '/usr/share/openstack-dashboard/static' }
|
||||
],
|
||||
port => 80,
|
||||
ssl_cert => $horizon_cert,
|
||||
ssl_key => $horizon_key,
|
||||
ssl_ca => $horizon_ca,
|
||||
wsgi_script_aliases => hash([$::horizon::params::root_url, $::horizon::params::django_wsgi]),
|
||||
wsgi_daemon_process => $::horizon::params::wsgi_group,
|
||||
servername => $servername,
|
||||
serveraliases => os_any2array($final_server_aliases),
|
||||
docroot => '/var/www/',
|
||||
access_log_file => 'horizon_access.log',
|
||||
error_log_file => 'horizon_error.log',
|
||||
priority => $priority,
|
||||
aliases => [{
|
||||
alias => '/static',
|
||||
path => '/usr/share/openstack-dashboard/static',
|
||||
}],
|
||||
port => 80,
|
||||
ssl_cert => $horizon_cert,
|
||||
ssl_key => $horizon_key,
|
||||
ssl_ca => $horizon_ca,
|
||||
wsgi_script_aliases => hash([$::horizon::params::root_url, $::horizon::params::django_wsgi]),
|
||||
wsgi_daemon_process => $::horizon::params::wsgi_group,
|
||||
wsgi_daemon_process_options => {
|
||||
processes => $wsgi_processes,
|
||||
threads => $wsgi_threads,
|
||||
user => $unix_user,
|
||||
group => $unix_group,
|
||||
processes => $wsgi_processes,
|
||||
threads => $wsgi_threads,
|
||||
user => $unix_user,
|
||||
group => $unix_group,
|
||||
},
|
||||
wsgi_import_script => $::horizon::params::django_wsgi,
|
||||
wsgi_process_group => $::horizon::params::wsgi_group,
|
||||
|
Reference in New Issue
Block a user