Skip to content

Commit

Permalink
Merge pull request #2235 from david22swan/GH-cat-9/syntax_standards
Browse files Browse the repository at this point in the history
(GH-cat-9) Update module to match current syntax standard
  • Loading branch information
chelnak authored Jun 7, 2022
2 parents 3619b33 + a1c95aa commit ad646c9
Show file tree
Hide file tree
Showing 85 changed files with 1,331 additions and 1,102 deletions.
8 changes: 6 additions & 2 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/pupp

// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
"terminal.integrated.profiles.linux": {
"bash": {
"path": "bash",
}
}
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"puppet.puppet-vscode",
"rebornix.Ruby"
]
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [],
Expand Down
8 changes: 0 additions & 8 deletions .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -1,10 +1,2 @@
--relative
--no-parameter_types-check
--no-parameter_documentation-check
--no-top_scope_facts-check
--no-legacy_facts-check
--no-relative_classname_reference-check
--no-relative_classname_inclusion-check
--no-anchor_resource-check
--no-version_comparison-check
--no-manifest_whitespace_closing_bracket_after-check
9 changes: 0 additions & 9 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,4 @@ Rakefile:
changelog_since_tag: "3.2.0"
Rakefile:
extra_disabled_lint_checks:
- parameter_types
- parameter_documentation
- top_scope_facts
- legacy_facts
- relative_classname_reference
- relative_classname_inclusion
- anchor_resource
- version_comparison
- manifest_whitespace_closing_bracket_after

2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ group :development do
gem "puppet-module-posix-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "voxpupuli-puppet-lint-plugins", '>= 3.0', require: false, platforms: [:ruby]
gem "voxpupuli-puppet-lint-plugins", '>= 3.0', require: false
gem "github_changelog_generator", require: false
end
group :system_tests do
Expand Down
8 changes: 0 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,7 @@ 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_top_scope_facts')
PuppetLint.configuration.send('disable_legacy_facts')
PuppetLint.configuration.send('disable_relative_classname_reference')
PuppetLint.configuration.send('disable_relative_classname_inclusion')
PuppetLint.configuration.send('disable_anchor_resource')
PuppetLint.configuration.send('disable_version_comparison')
PuppetLint.configuration.send('disable_manifest_whitespace_closing_bracket_after')


if Bundler.rubygems.find_name('github_changelog_generator').any?
Expand Down
8 changes: 4 additions & 4 deletions manifests/balancer.pp
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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://${::fqdn}/",
$options = [],
String $balancer_cluster,
String $url = "http://${$facts['networking']['fqdn']}/",
Array $options = [],
) {
concat::fragment { "BalancerMember ${name}":
target => "apache_balancer_${balancer_cluster}",
Expand Down
24 changes: 12 additions & 12 deletions manifests/custom_config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@
# show_diff property for configuration file resource
#
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,
Boolean $verify_config = true,
$filename = undef,
$owner = undef,
$group = undef,
$file_mode = undef,
Boolean $show_diff = true,
Enum['absent', 'present'] $ensure = 'present',
String $confdir = $apache::confd_dir,
Optional[String] $content = undef,
Variant[Integer,String,Boolean] $priority = '25',
Optional[String] $source = undef,
String $verify_command = $apache::params::verify_command,
Boolean $verify_config = true,
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 {
fail('Only one of $content and $source can be specified.')
Expand Down
4 changes: 2 additions & 2 deletions manifests/default_confd_files.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
#
# @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 {
case $::osfamily {
case $facts['os']['family'] {
'freebsd': {
include apache::confd::no_accf
}
Expand Down
18 changes: 9 additions & 9 deletions manifests/default_mods.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
#
# @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
# them to make sure it works.
case $::osfamily {
case $facts['os']['family'] {
'redhat': {
::apache::mod { 'log_config': }
if versioncmp($apache_version, '2.4') >= 0 {
# Lets fork it
# Do not try to load mod_systemd on RHEL/CentOS 6 SCL.
if ( !($::osfamily == 'redhat' and versioncmp($::operatingsystemmajrelease, '7') == -1) and !($::operatingsystem == 'Amazon') ) {
if ( !($facts['os']['family'] == 'redhat' and versioncmp($facts['os']['release']['major'], '7') == -1) and !($facts['os']['name'] == 'Amazon') ) {
if ($use_systemd) {
::apache::mod { 'systemd': }
}
}
if ($::operatingsystem == 'Amazon' and $::operatingsystemrelease == '2') {
if ($facts['os']['name'] == 'Amazon' and $facts['os']['release']['full'] == '2') {
::apache::mod { 'systemd': }
}
::apache::mod { 'unixd': }
Expand All @@ -37,15 +37,15 @@
}
default: {}
}
case $::osfamily {
case $facts['os']['family'] {
'gentoo': {}
default: {
::apache::mod { 'authz_host': }
}
}
# The rest of the modules only get loaded if we want all modules enabled
if $all {
case $::osfamily {
case $facts['os']['family'] {
'debian': {
include apache::mod::authn_core
include apache::mod::reqtimeout
Expand Down
2 changes: 1 addition & 1 deletion manifests/default_mods/load.pp
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit ad646c9

Please sign in to comment.