Skip to content

Commit

Permalink
(GH-cat-9) Update code to match syntax standard, part 2
Browse files Browse the repository at this point in the history
Code now compliant with the following rules:
- parameter_documentation
- parameter_types
  • Loading branch information
david22swan committed Jun 6, 2022
1 parent 08f7a48 commit ae56cc9
Show file tree
Hide file tree
Showing 66 changed files with 1,075 additions and 895 deletions.
2 changes: 0 additions & 2 deletions .puppet-lint.rc
@@ -1,4 +1,2 @@
--relative
--no-parameter_types-check
--no-parameter_documentation-check
--no-anchor_resource-check
2 changes: 0 additions & 2 deletions .sync.yml
Expand Up @@ -37,6 +37,4 @@ Rakefile:
changelog_since_tag: "3.2.0"
Rakefile:
extra_disabled_lint_checks:
- parameter_types
- parameter_documentation
- anchor_resource
2 changes: 0 additions & 2 deletions Rakefile
Expand Up @@ -42,8 +42,6 @@ def changelog_future_release
end

PuppetLint.configuration.send('disable_relative')
PuppetLint.configuration.send('disable_parameter_types')
PuppetLint.configuration.send('disable_parameter_documentation')
PuppetLint.configuration.send('disable_anchor_resource')


Expand Down
8 changes: 4 additions & 4 deletions manifests/balancer.pp
Expand Up @@ -43,10 +43,10 @@
# apache::balancer { 'puppet00': }
#
define apache::balancer (
$proxy_set = {},
$collect_exported = true,
$target = undef,
$options = [],
Hash $proxy_set = {},
Boolean $collect_exported = true,
Optional[String] $target = undef,
Array $options = [],
) {
include apache::mod::proxy_balancer

Expand Down
8 changes: 4 additions & 4 deletions manifests/balancermember.pp
Expand Up @@ -27,7 +27,7 @@
# @param url
# The url used to contact the balancer member server.
#
# @param options
# @param options
# Specifies an array of [options](https://httpd.apache.org/docs/current/mod/mod_proxy.html#balancermember)
# after the URL, and accepts any key-value pairs available to `ProxyPass`.
#
Expand All @@ -39,9 +39,9 @@
# }
#
define apache::balancermember (
$balancer_cluster,
$url = "http://${$facts['networking']['fqdn']}/",
$options = [],
String $balancer_cluster,
String $url = "http://${$facts['networking']['fqdn']}/",
Array $options = [],
) {
concat::fragment { "BalancerMember ${name}":
target => "apache_balancer_${balancer_cluster}",
Expand Down
18 changes: 9 additions & 9 deletions manifests/custom_config.pp
Expand Up @@ -50,16 +50,16 @@
#
define apache::custom_config (
Enum['absent', 'present'] $ensure = 'present',
$confdir = $apache::confd_dir,
$content = undef,
$priority = '25',
$source = undef,
$verify_command = $apache::params::verify_command,
String $confdir = $apache::confd_dir,
Optional[String] $content = undef,
Variant[String,Boolean] $priority = '25',
Optional[String] $source = undef,
String $verify_command = $apache::params::verify_command,
Boolean $verify_config = true,
$filename = undef,
$owner = undef,
$group = undef,
$file_mode = undef,
Optional[String] $filename = undef,
Optional[String] $owner = undef,
Optional[String] $group = undef,
Optional[String] $file_mode = undef,
Boolean $show_diff = true,
) {
if $content and $source {
Expand Down
2 changes: 1 addition & 1 deletion manifests/default_confd_files.pp
Expand Up @@ -3,7 +3,7 @@
#
# @api private
class apache::default_confd_files (
$all = true,
Boolean $all = true,
) {
# The rest of the conf.d/* files only get loaded if we want them
if $all {
Expand Down
8 changes: 4 additions & 4 deletions manifests/default_mods.pp
Expand Up @@ -3,10 +3,10 @@
#
# @api private
class apache::default_mods (
$all = true,
$mods = undef,
$apache_version = $apache::apache_version,
$use_systemd = $apache::use_systemd,
Boolean $all = true,
Optional[Variant[Array[String],String]] $mods = undef,
String $apache_version = $apache::apache_version,
Boolean $use_systemd = $apache::use_systemd,
) {
# These are modules required to run the default configuration.
# They are not configurable at this time, so we just include
Expand Down
2 changes: 1 addition & 1 deletion manifests/default_mods/load.pp
Expand Up @@ -2,7 +2,7 @@
# Helper used by `apache::default_mods`
#
# @api private
define apache::default_mods::load ($module = $title) {
define apache::default_mods::load (String $module = $title) {
if defined("apache::mod::${module}") {
include "::apache::mod::${module}"
} else {
Expand Down
17 changes: 10 additions & 7 deletions manifests/fastcgi/server.pp
Expand Up @@ -28,14 +28,17 @@
# @param file_type
# Sets the MIME `content-type` of the file to be processed by the FastCGI server.
#
# @param pass_header
# Sets a header for the server
#
define apache::fastcgi::server (
$host = '127.0.0.1:9000',
$timeout = 15,
$flush = false,
$faux_path = "/var/www/${name}.fcgi",
$fcgi_alias = "/${name}.fcgi",
$file_type = 'application/x-httpd-php',
$pass_header = undef,
String $host = '127.0.0.1:9000',
Integer $timeout = 15,
Boolean $flush = false,
String $faux_path = "/var/www/${name}.fcgi",
String $fcgi_alias = "/${name}.fcgi",
String $file_type = 'application/x-httpd-php',
Optional[String] $pass_header = undef,
) {
include apache::mod::fastcgi

Expand Down
144 changes: 72 additions & 72 deletions manifests/init.pp
Expand Up @@ -461,92 +461,92 @@
# Specifies any idditional Internet media (mime) types that you wish to be configured.
#
class apache (
$apache_name = $apache::params::apache_name,
$service_name = $apache::params::service_name,
$default_mods = true,
String $apache_name = $apache::params::apache_name,
String $service_name = $apache::params::service_name,
Variant[Array,Boolean] $default_mods = true,
Boolean $default_vhost = true,
$default_charset = undef,
Optional[String] $default_charset = undef,
Boolean $default_confd_files = true,
Boolean $default_ssl_vhost = false,
$default_ssl_cert = $apache::params::default_ssl_cert,
$default_ssl_key = $apache::params::default_ssl_key,
$default_ssl_chain = undef,
$default_ssl_ca = undef,
$default_ssl_crl_path = undef,
$default_ssl_crl = undef,
$default_ssl_crl_check = undef,
String $default_ssl_cert = $apache::params::default_ssl_cert,
String $default_ssl_key = $apache::params::default_ssl_key,
Optional[String] $default_ssl_chain = undef,
Optional[String] $default_ssl_ca = undef,
Optional[String] $default_ssl_crl_path = undef,
Optional[String] $default_ssl_crl = undef,
Optional[String] $default_ssl_crl_check = undef,
Boolean $default_ssl_reload_on_change = false,
$default_type = 'none',
$dev_packages = $apache::params::dev_packages,
$ip = undef,
String $default_type = 'none',
Optional[Variant[Array,String]] $dev_packages = $apache::params::dev_packages,
Optional[String] $ip = undef,
Boolean $service_enable = true,
Boolean $service_manage = true,
$service_ensure = 'running',
$service_restart = undef,
$purge_configs = true,
$purge_vhost_dir = undef,
$purge_vdir = false,
$serveradmin = 'root@localhost',
Variant[Boolean,String] $service_ensure = 'running',
Optional[String] $service_restart = undef,
Boolean $purge_configs = true,
Optional[Boolean] $purge_vhost_dir = undef,
Boolean $purge_vdir = false,
String $serveradmin = 'root@localhost',
Enum['On', 'Off', 'on', 'off'] $sendfile = 'On',
$ldap_verify_server_cert = undef,
$ldap_trusted_mode = undef,
$error_documents = false,
$timeout = '60',
$httpd_dir = $apache::params::httpd_dir,
$server_root = $apache::params::server_root,
$conf_dir = $apache::params::conf_dir,
$confd_dir = $apache::params::confd_dir,
Optional[Enum['On', 'Off', 'on', 'off']] $ldap_verify_server_cert = undef,
Optional[String] $ldap_trusted_mode = undef,
Boolean $error_documents = false,
String $timeout = '60',

This comment has been minimized.

Copy link
@HT43-bqxFqB

HT43-bqxFqB Jun 8, 2022

Contributor

Why is this a String instead of an Integer type? This failed some of our unit tests as we require and give Integer as parameter.

This comment has been minimized.

Copy link
@david22swan

david22swan Jun 9, 2022

Author Member

Apologies, that should have been Variant[Integer,String].
Have put a fix up for it now: #2242

If you see any more instances such as this please point them out.

This comment has been minimized.

Copy link
@HT43-bqxFqB

HT43-bqxFqB Jun 9, 2022

Contributor

Will do, thanks.

String $httpd_dir = $apache::params::httpd_dir,
String $server_root = $apache::params::server_root,
String $conf_dir = $apache::params::conf_dir,
String $confd_dir = $apache::params::confd_dir,
Enum['Off', 'On', 'Double', 'off', 'on', 'double'] $hostname_lookups = $apache::params::hostname_lookups,
$conf_enabled = $apache::params::conf_enabled,
$vhost_dir = $apache::params::vhost_dir,
$vhost_enable_dir = $apache::params::vhost_enable_dir,
$mod_libs = $apache::params::mod_libs,
$mod_packages = $apache::params::mod_packages,
$vhost_include_pattern = $apache::params::vhost_include_pattern,
$mod_dir = $apache::params::mod_dir,
$mod_enable_dir = $apache::params::mod_enable_dir,
$mpm_module = $apache::params::mpm_module,
$lib_path = $apache::params::lib_path,
$conf_template = $apache::params::conf_template,
$servername = $apache::params::servername,
$pidfile = $apache::params::pidfile,
Optional[String] $conf_enabled = $apache::params::conf_enabled,
String $vhost_dir = $apache::params::vhost_dir,
Optional[String] $vhost_enable_dir = $apache::params::vhost_enable_dir,
Hash $mod_libs = $apache::params::mod_libs,
Hash $mod_packages = $apache::params::mod_packages,
String $vhost_include_pattern = $apache::params::vhost_include_pattern,
String $mod_dir = $apache::params::mod_dir,
Optional[String] $mod_enable_dir = $apache::params::mod_enable_dir,
Variant[Boolean,String] $mpm_module = $apache::params::mpm_module,
String $lib_path = $apache::params::lib_path,
String $conf_template = $apache::params::conf_template,
Optional[String] $servername = $apache::params::servername,
String $pidfile = $apache::params::pidfile,
Optional[Stdlib::Absolutepath] $rewrite_lock = undef,
Boolean $manage_user = true,
Boolean $manage_group = true,
$user = $apache::params::user,
$group = $apache::params::group,
$http_protocol_options = $apache::params::http_protocol_options,
$supplementary_groups = [],
$keepalive = $apache::params::keepalive,
$keepalive_timeout = $apache::params::keepalive_timeout,
$max_keepalive_requests = $apache::params::max_keepalive_requests,
$limitreqfieldsize = '8190',
$limitreqfields = '100',
$logroot = $apache::params::logroot,
$logroot_mode = $apache::params::logroot_mode,
String $user = $apache::params::user,
String $group = $apache::params::group,
Optional[String] $http_protocol_options = $apache::params::http_protocol_options,
Array $supplementary_groups = [],
String $keepalive = $apache::params::keepalive,
Variant[Integer,String] $keepalive_timeout = $apache::params::keepalive_timeout,
Variant[Integer,String] $max_keepalive_requests = $apache::params::max_keepalive_requests,
String $limitreqfieldsize = '8190',
String $limitreqfields = '100',
String $logroot = $apache::params::logroot,
Optional[String] $logroot_mode = $apache::params::logroot_mode,
Apache::LogLevel $log_level = $apache::params::log_level,
$log_formats = {},
$ssl_file = undef,
$ports_file = $apache::params::ports_file,
$docroot = $apache::params::docroot,
$apache_version = $apache::version::default,
$server_tokens = 'Prod',
$server_signature = 'On',
$trace_enable = 'On',
Hash $log_formats = {},
Optional[String] $ssl_file = undef,
String $ports_file = $apache::params::ports_file,
String $docroot = $apache::params::docroot,
String $apache_version = $apache::version::default,
String $server_tokens = 'Prod',
String $server_signature = 'On',
String $trace_enable = 'On',
Optional[Enum['on', 'off', 'nodecode']] $allow_encoded_slashes = undef,
$file_e_tag = undef,
Optional[String] $file_e_tag = undef,
Optional[Enum['On', 'on', 'Off', 'off', 'DNS', 'dns']]
$use_canonical_name = undef,
$package_ensure = 'installed',
Boolean $use_optional_includes = $apache::params::use_optional_includes,
$use_systemd = $apache::params::use_systemd,
$mime_types_additional = $apache::params::mime_types_additional,
$file_mode = $apache::params::file_mode,
$root_directory_options = $apache::params::root_directory_options,
Boolean $root_directory_secured = false,
$error_log = $apache::params::error_log,
$scriptalias = $apache::params::scriptalias,
$access_log_file = $apache::params::access_log_file,
$use_canonical_name = undef,
String $package_ensure = 'installed',
Boolean $use_optional_includes = $apache::params::use_optional_includes,
Boolean $use_systemd = $apache::params::use_systemd,
Hash $mime_types_additional = $apache::params::mime_types_additional,
String $file_mode = $apache::params::file_mode,
Array $root_directory_options = $apache::params::root_directory_options,
Boolean $root_directory_secured = false,
String $error_log = $apache::params::error_log,
String $scriptalias = $apache::params::scriptalias,
String $access_log_file = $apache::params::access_log_file,
Array[Enum['h2', 'h2c', 'http/1.1']] $protocols = [],
Optional[Boolean] $protocols_honor_order = undef,
) inherits apache::params {
Expand Down

0 comments on commit ae56cc9

Please sign in to comment.