Skip to content

Commit b21e1b2

Browse files
committed
Add explicit parameter types to all parameters
1 parent 65b7c74 commit b21e1b2

File tree

7 files changed

+165
-165
lines changed

7 files changed

+165
-165
lines changed

manifests/init.pp

Lines changed: 124 additions & 124 deletions
Large diffs are not rendered by default.

manifests/resource/mailhost.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
Optional[String] $ssl_trusted_cert = undef,
105105
Optional[Integer] $ssl_verify_depth = undef,
106106
Enum['on', 'off', 'only'] $starttls = 'off',
107-
$protocol = undef,
107+
Optional[String] $protocol = undef,
108108
Optional[String] $auth_http = undef,
109109
Optional[String] $auth_http_header = undef,
110110
String $xclient = 'on',
@@ -120,7 +120,7 @@
120120
Optional[Hash] $mailhost_cfg_prepend = undef,
121121
Optional[Hash] $mailhost_cfg_append = undef,
122122
String $proxy_pass_error_message = 'off',
123-
Array $server_name = [$name]
123+
Array[String] $server_name = [$name]
124124
) {
125125

126126
if ! defined(Class['nginx']) {

manifests/resource/server.pp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
Integer $ssl_port = 443,
166166
Enum['on', 'off'] $ssl_prefer_server_ciphers = $::nginx::ssl_prefer_server_ciphers,
167167
String $ssl_protocols = $::nginx::ssl_protocols,
168-
$ssl_buffer_size = undef,
168+
String $ssl_buffer_size = undef,
169169
String $ssl_ciphers = $::nginx::ssl_ciphers,
170170
String $ssl_cache = 'shared:SSL:10m',
171171
Optional[String] $ssl_crl = undef,
@@ -178,12 +178,12 @@
178178
Optional[String] $ssl_session_ticket_key = undef,
179179
Optional[String] $ssl_trusted_cert = undef,
180180
String $spdy = $::nginx::spdy,
181-
$http2 = $::nginx::http2,
181+
Enum['on','off'] $http2 = $::nginx::http2,
182182
Optional[String] $proxy = undef,
183183
Optional[String]$proxy_redirect = undef,
184184
String $proxy_read_timeout = $::nginx::proxy_read_timeout,
185185
String $proxy_send_timeout = $::nginx::proxy_send_timeout,
186-
$proxy_connect_timeout = $::nginx::proxy_connect_timeout,
186+
String $proxy_connect_timeout = $::nginx::proxy_connect_timeout,
187187
Array[String] $proxy_set_header = $::nginx::proxy_set_header,
188188
Array[String] $proxy_hide_header = $::nginx::proxy_hide_header,
189189
Array[String] $proxy_pass_header = $::nginx::proxy_pass_header,
@@ -200,7 +200,7 @@
200200
Array $resolver = [],
201201
Optional[String] $fastcgi = undef,
202202
Optional[String] $fastcgi_index = undef,
203-
$fastcgi_param = undef,
203+
Optional[Hash] $fastcgi_param = undef,
204204
String $fastcgi_params = "${::nginx::conf_dir}/fastcgi.conf",
205205
Optional[String] $fastcgi_script = undef,
206206
Optional[String] $uwsgi = undef,
@@ -225,7 +225,7 @@
225225
Optional[String] $auth_request = undef,
226226
Optional[String] $client_body_timeout = undef,
227227
Optional[String] $client_header_timeout = undef,
228-
$client_max_body_size = undef,
228+
Optional[String] $client_max_body_size = undef,
229229
Optional[Variant[Array[String], String]] $raw_prepend = undef,
230230
Optional[Variant[Array[String], String]] $raw_append = undef,
231231
Optional[Variant[Array[String], String]] $location_raw_prepend = undef,
@@ -237,24 +237,24 @@
237237
Optional[Array[String]] $include_files = undef,
238238
Optional[Variant[String, Array]] $access_log = undef,
239239
Optional[Variant[String, Array]] $error_log = undef,
240-
$format_log = 'combined',
240+
String $format_log = 'combined',
241241
Optional[Hash] $passenger_cgi_param = undef,
242242
Optional[Hash] $passenger_set_header = undef,
243243
Optional[Hash] $passenger_env_var = undef,
244244
Optional[Variant[Array[String], String]] $passenger_pre_start = undef,
245245
Optional[String] $log_by_lua = undef,
246246
Optional[String] $log_by_lua_file = undef,
247-
$use_default_location = true,
248-
$rewrite_rules = [],
249-
$string_mappings = {},
250-
$geo_mappings = {},
247+
Boolean $use_default_location = true,
248+
Array[String] $rewrite_rules = [],
249+
Hash[String] $string_mappings = {},
250+
Hash[String] $geo_mappings = {},
251251
Optional[String] $gzip_types = undef,
252252
String $owner = $::nginx::global_owner,
253253
String $group = $::nginx::global_group,
254254
String $mode = $::nginx::global_mode,
255255
Boolean $maintenance = false,
256256
String $maintenance_value = 'return 503',
257-
$error_pages = undef,
257+
Optional[Hash] $error_pages = undef,
258258
Hash $locations = {},
259259
Hash $locations_defaults = {}
260260
) {

manifests/resource/streamhost.pp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,23 @@
4747
# ensure => present,
4848
# }
4949
define nginx::resource::streamhost (
50-
Enum['absent', 'present'] $ensure = 'present',
51-
Variant[Array, String] $listen_ip = '*',
52-
Integer $listen_port = 80,
53-
Optional[String] $listen_options = undef,
54-
Boolean $ipv6_enable = false,
55-
Variant[Array, String] $ipv6_listen_ip = '::',
56-
Integer $ipv6_listen_port = 80,
57-
String $ipv6_listen_options = 'default ipv6only=on',
58-
$proxy = undef,
59-
String $proxy_read_timeout = $::nginx::proxy_read_timeout,
60-
$proxy_connect_timeout = $::nginx::proxy_connect_timeout,
61-
Array $resolver = [],
62-
$raw_prepend = undef,
63-
$raw_append = undef,
64-
String $owner = $::nginx::global_owner,
65-
String $group = $::nginx::global_group,
66-
String $mode = $::nginx::global_mode,
50+
Enum['absent', 'present'] $ensure = 'present',
51+
Variant[Array, String] $listen_ip = '*',
52+
Integer $listen_port = 80,
53+
Optional[String] $listen_options = undef,
54+
Boolean $ipv6_enable = false,
55+
Variant[Array, String] $ipv6_listen_ip = '::',
56+
Integer $ipv6_listen_port = 80,
57+
String $ipv6_listen_options = 'default ipv6only=on',
58+
String $proxy = undef,
59+
String $proxy_read_timeout = $::nginx::proxy_read_timeout,
60+
String $proxy_connect_timeout = $::nginx::proxy_connect_timeout,
61+
Array $resolver = [],
62+
Optional[Variant[Array[String], String]] $raw_prepend = undef,
63+
Optional[Variant[Array[String], String]] $raw_append = undef,
64+
String $owner = $::nginx::global_owner,
65+
String $group = $::nginx::global_group,
66+
String $mode = $::nginx::global_mode,
6767
) {
6868

6969
if ! defined(Class['nginx']) {

manifests/resource/upstream.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@
4242
# }
4343
define nginx::resource::upstream (
4444
Optional[Array] $members = undef,
45-
$members_tag = undef,
45+
Optional[String] $members_tag = undef,
4646
Enum['present', 'absent'] $ensure = 'present',
4747
Optional[Hash] $upstream_cfg_append = undef,
4848
Optional[Hash] $upstream_cfg_prepend = undef,
49-
$upstream_fail_timeout = '10s',
50-
$upstream_max_fails = undef,
49+
String $upstream_fail_timeout = '10s',
50+
Optional[Integer] $upstream_max_fails = undef,
5151
Enum['http', 'stream'] $upstream_context = 'http',
5252
) {
5353

manifests/resource/upstream/member.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@
3535
# }
3636
#
3737
define nginx::resource::upstream::member (
38-
$upstream,
39-
$server,
38+
String $upstream,
39+
String $server,
4040
Enum['present', 'absent'] $ensure = 'present',
4141
Integer $port = 80,
42-
$upstream_fail_timeout = '10s',
42+
String $upstream_fail_timeout = '10s',
4343
) {
4444
if ! defined(Class['nginx']) {
4545
fail('You must include the nginx base class before using any defined resources')

manifests/service.pp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
#
1515
# This class file is not called directly
1616
class nginx::service(
17-
$service_restart = $::nginx::service_restart,
18-
$service_ensure = $::nginx::service_ensure,
19-
$service_name = $::nginx::service_name,
20-
$service_flags = $::nginx::service_flags,
21-
$service_manage = $::nginx::service_manage,
17+
Optional[Boolean] $service_restart = $::nginx::service_restart,
18+
Enum['running', 'absent', 'stopped', 'undef'] $service_ensure = $::nginx::service_ensure,
19+
String $service_name = $::nginx::service_name,
20+
Optional[String] $service_flags = $::nginx::service_flags,
21+
Boolean $service_manage = $::nginx::service_manage,
2222
) {
2323

2424
assert_private()

0 commit comments

Comments
 (0)