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
|
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 '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 'rspec-puppet', '~> 1.0.1'
|
||||||
gem 'rake', '10.1.1'
|
gem 'rake', '10.1.1'
|
||||||
gem 'rspec', '< 2.99'
|
gem 'rspec', '< 2.99'
|
||||||
|
5
Rakefile
5
Rakefile
@@ -1,6 +1,11 @@
|
|||||||
require 'puppetlabs_spec_helper/rake_tasks'
|
require 'puppetlabs_spec_helper/rake_tasks'
|
||||||
require 'puppet-lint/tasks/puppet-lint'
|
require 'puppet-lint/tasks/puppet-lint'
|
||||||
|
require 'puppet-syntax/tasks/puppet-syntax'
|
||||||
|
|
||||||
PuppetLint.configuration.fail_on_warnings = true
|
PuppetLint.configuration.fail_on_warnings = true
|
||||||
PuppetLint.configuration.send('disable_80chars')
|
PuppetLint.configuration.send('disable_80chars')
|
||||||
PuppetLint.configuration.send('disable_class_parameter_defaults')
|
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.
|
# Specify an absolute pathname.
|
||||||
# Defaults to /tmp
|
# 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*]
|
# [*secure_cookies*]
|
||||||
# (optional) Enables security settings for cookies. Useful when using
|
# (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
|
# 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 = {
|
$hypervisor_defaults = {
|
||||||
'can_set_mount_point' => true,
|
'can_set_mount_point' => true,
|
||||||
'can_set_password' => false
|
'can_set_password' => false,
|
||||||
}
|
}
|
||||||
|
|
||||||
if $fqdn {
|
if $fqdn {
|
||||||
@@ -248,14 +260,14 @@ class horizon(
|
|||||||
'enable_quotas' => true,
|
'enable_quotas' => true,
|
||||||
'enable_security_group' => true,
|
'enable_security_group' => true,
|
||||||
'enable_vpn' => false,
|
'enable_vpn' => false,
|
||||||
'profile_support' => 'None'
|
'profile_support' => 'None',
|
||||||
}
|
}
|
||||||
|
|
||||||
Service <| title == 'memcached' |> -> Class['horizon']
|
Service <| title == 'memcached' |> -> Class['horizon']
|
||||||
|
|
||||||
package { 'horizon':
|
package { 'horizon':
|
||||||
ensure => $package_ensure,
|
ensure => $package_ensure,
|
||||||
name => $::horizon::params::package_name,
|
name => $::horizon::params::package_name,
|
||||||
}
|
}
|
||||||
|
|
||||||
concat { $::horizon::params::config_file:
|
concat { $::horizon::params::config_file:
|
||||||
@@ -266,7 +278,7 @@ class horizon(
|
|||||||
concat::fragment { 'local_settings.py':
|
concat::fragment { 'local_settings.py':
|
||||||
target => $::horizon::params::config_file,
|
target => $::horizon::params::config_file,
|
||||||
content => template($local_settings_template),
|
content => template($local_settings_template),
|
||||||
order => '50'
|
order => '50',
|
||||||
}
|
}
|
||||||
|
|
||||||
package { 'python-lesscpy':
|
package { 'python-lesscpy':
|
||||||
@@ -284,7 +296,7 @@ class horizon(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if $configure_apache {
|
if $configure_apache {
|
||||||
class { 'horizon::wsgi::apache':
|
class { '::horizon::wsgi::apache':
|
||||||
bind_address => $bind_address,
|
bind_address => $bind_address,
|
||||||
servername => $servername,
|
servername => $servername,
|
||||||
server_aliases => $final_server_aliases,
|
server_aliases => $final_server_aliases,
|
||||||
@@ -302,7 +314,7 @@ class horizon(
|
|||||||
ensure => directory,
|
ensure => directory,
|
||||||
owner => $::horizon::params::wsgi_user,
|
owner => $::horizon::params::wsgi_user,
|
||||||
group => $::horizon::params::wsgi_group,
|
group => $::horizon::params::wsgi_group,
|
||||||
mode => '0755'
|
mode => '0755',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -4,41 +4,61 @@
|
|||||||
#
|
#
|
||||||
# === Parameters
|
# === Parameters
|
||||||
#
|
#
|
||||||
# [*bind_address*]
|
# [*bind_address*]
|
||||||
# (optional) Bind address in Apache for Horizon. (Defaults to '0.0.0.0')
|
# (optional) Bind address in Apache for Horizon. (Defaults to '0.0.0.0')
|
||||||
#
|
#
|
||||||
# [*server_aliases*]
|
# [*fqdn*]
|
||||||
# (optional) List of names which should be defined as ServerAlias directives
|
# (Optional) Fqdn
|
||||||
# in vhost.conf.
|
# Defaults to undef.
|
||||||
# Defaults to ::fqdn.
|
|
||||||
#
|
#
|
||||||
# [*listen_ssl*]
|
# [*servername*]
|
||||||
# (optional) Enable SSL support in Apache. (Defaults to false)
|
# (Optional) Server Name
|
||||||
|
# Defaults to ::fqdn.
|
||||||
#
|
#
|
||||||
# [*horizon_cert*]
|
# [*ssl_redirect*]
|
||||||
# (required with listen_ssl) Certificate to use for SSL support.
|
# (Optional) Enable SSL Redirect
|
||||||
|
# Defaults to 'true'.
|
||||||
#
|
#
|
||||||
# [*horizon_key*]
|
# [*server_aliases*]
|
||||||
# (required with listen_ssl) Private key to use for SSL support.
|
# (optional) List of names which should be defined as ServerAlias directives
|
||||||
|
# in vhost.conf.
|
||||||
|
# Defaults to ::fqdn.
|
||||||
#
|
#
|
||||||
# [*horizon_ca*]
|
# [*listen_ssl*]
|
||||||
# (required with listen_ssl) CA certificate to use for SSL support.
|
# (optional) Enable SSL support in Apache. (Defaults to false)
|
||||||
#
|
#
|
||||||
# [*wsgi_processes*]
|
# [*horizon_cert*]
|
||||||
# (optional) Number of Horizon processes to spawn
|
# (required with listen_ssl) Certificate to use for SSL support.
|
||||||
# Defaults to '3'
|
|
||||||
#
|
#
|
||||||
# [*wsgi_threads*]
|
# [*horizon_key*]
|
||||||
# (optional) Number of thread to run in a Horizon process
|
# (required with listen_ssl) Private key to use for SSL support.
|
||||||
# Defaults to '10'
|
|
||||||
#
|
#
|
||||||
# [*priority*]
|
# [*horizon_ca*]
|
||||||
# (optional) The apache vhost priority.
|
# (required with listen_ssl) CA certificate to use for SSL support.
|
||||||
# Defaults to '15'. To set Horizon as the primary vhost, change to '10'.
|
|
||||||
#
|
#
|
||||||
# [*extra_params*]
|
# [*wsgi_processes*]
|
||||||
# (optional) A hash of extra paramaters for apache::wsgi class.
|
# (optional) Number of Horizon processes to spawn
|
||||||
# Defaults to {}
|
# 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 (
|
class horizon::wsgi::apache (
|
||||||
$bind_address = undef,
|
$bind_address = undef,
|
||||||
$fqdn = undef,
|
$fqdn = undef,
|
||||||
@@ -81,7 +101,7 @@ class horizon::wsgi::apache (
|
|||||||
# - ${priority}-${vhost_conf_name}.conf
|
# - ${priority}-${vhost_conf_name}.conf
|
||||||
# - ${priority}-${vhost_ssl_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:
|
file { $::horizon::params::logdir:
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
owner => $unix_user,
|
owner => $unix_user,
|
||||||
group => $unix_group,
|
group => $unix_group,
|
||||||
before => Service[$::horizon::params::http_service],
|
before => Service[$::horizon::params::http_service],
|
||||||
mode => '0751',
|
mode => '0751',
|
||||||
require => Package['horizon']
|
require => Package['horizon'],
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "${::horizon::params::logdir}/horizon.log":
|
file { "${::horizon::params::logdir}/horizon.log":
|
||||||
ensure => file,
|
ensure => file,
|
||||||
owner => $unix_user,
|
owner => $unix_user,
|
||||||
group => $unix_group,
|
group => $unix_group,
|
||||||
before => Service[$::horizon::params::http_service],
|
before => Service[$::horizon::params::http_service],
|
||||||
mode => '0640',
|
mode => '0640',
|
||||||
require => [ File[$::horizon::params::logdir], Package['horizon'] ],
|
require => [ File[$::horizon::params::logdir], Package['horizon'] ],
|
||||||
}
|
}
|
||||||
|
|
||||||
$default_vhost_conf_no_ip = {
|
$default_vhost_conf_no_ip = {
|
||||||
servername => $servername,
|
servername => $servername,
|
||||||
serveraliases => os_any2array($final_server_aliases),
|
serveraliases => os_any2array($final_server_aliases),
|
||||||
docroot => '/var/www/',
|
docroot => '/var/www/',
|
||||||
access_log_file => 'horizon_access.log',
|
access_log_file => 'horizon_access.log',
|
||||||
error_log_file => 'horizon_error.log',
|
error_log_file => 'horizon_error.log',
|
||||||
priority => $priority,
|
priority => $priority,
|
||||||
aliases => [
|
aliases => [{
|
||||||
{ alias => '/static', path => '/usr/share/openstack-dashboard/static' }
|
alias => '/static',
|
||||||
],
|
path => '/usr/share/openstack-dashboard/static',
|
||||||
port => 80,
|
}],
|
||||||
ssl_cert => $horizon_cert,
|
port => 80,
|
||||||
ssl_key => $horizon_key,
|
ssl_cert => $horizon_cert,
|
||||||
ssl_ca => $horizon_ca,
|
ssl_key => $horizon_key,
|
||||||
wsgi_script_aliases => hash([$::horizon::params::root_url, $::horizon::params::django_wsgi]),
|
ssl_ca => $horizon_ca,
|
||||||
wsgi_daemon_process => $::horizon::params::wsgi_group,
|
wsgi_script_aliases => hash([$::horizon::params::root_url, $::horizon::params::django_wsgi]),
|
||||||
|
wsgi_daemon_process => $::horizon::params::wsgi_group,
|
||||||
wsgi_daemon_process_options => {
|
wsgi_daemon_process_options => {
|
||||||
processes => $wsgi_processes,
|
processes => $wsgi_processes,
|
||||||
threads => $wsgi_threads,
|
threads => $wsgi_threads,
|
||||||
user => $unix_user,
|
user => $unix_user,
|
||||||
group => $unix_group,
|
group => $unix_group,
|
||||||
},
|
},
|
||||||
wsgi_import_script => $::horizon::params::django_wsgi,
|
wsgi_import_script => $::horizon::params::django_wsgi,
|
||||||
wsgi_process_group => $::horizon::params::wsgi_group,
|
wsgi_process_group => $::horizon::params::wsgi_group,
|
||||||
|
Reference in New Issue
Block a user