From e15b11aa27dc0573b08e4aff1e19fc5a64a717f4 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Wed, 28 Jun 2023 09:04:18 +0200 Subject: [PATCH 1/5] init.pp: Add missing datatypes --- REFERENCE.md | 58 +++++++++++++++++++++++------------------------ manifests/init.pp | 58 +++++++++++++++++++++++------------------------ 2 files changed, 58 insertions(+), 58 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index a9b38b42a..5412b5cde 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -629,7 +629,7 @@ Default value: `'on'` ##### `accept_mutex_delay` -Data type: `Any` +Data type: `String` @@ -637,7 +637,7 @@ Default value: `'500ms'` ##### `client_body_buffer_size` -Data type: `Any` +Data type: `String` @@ -653,7 +653,7 @@ Default value: `'10m'` ##### `client_body_timeout` -Data type: `Any` +Data type: `String` @@ -661,7 +661,7 @@ Default value: `'60s'` ##### `send_timeout` -Data type: `Any` +Data type: `String` @@ -669,7 +669,7 @@ Default value: `'60s'` ##### `lingering_timeout` -Data type: `Any` +Data type: `String` @@ -773,7 +773,7 @@ Default value: `'off'` ##### `gzip_buffers` -Data type: `Any` +Data type: `Optional[String]` @@ -781,7 +781,7 @@ Default value: `undef` ##### `gzip_comp_level` -Data type: `Any` +Data type: `Integer` @@ -789,7 +789,7 @@ Default value: `1` ##### `gzip_disable` -Data type: `Any` +Data type: `String` @@ -797,7 +797,7 @@ Default value: `'msie6'` ##### `gzip_min_length` -Data type: `Any` +Data type: `Integer` @@ -805,7 +805,7 @@ Default value: `20` ##### `gzip_http_version` -Data type: `Any` +Data type: `Float` @@ -821,7 +821,7 @@ Default value: `'off'` ##### `gzip_types` -Data type: `Any` +Data type: `Optional[Variant[String[1],Array[String[1]]]]` @@ -893,7 +893,7 @@ Default value: `'off'` ##### `keepalive_timeout` -Data type: `Any` +Data type: `String` @@ -901,7 +901,7 @@ Default value: `'65s'` ##### `keepalive_requests` -Data type: `Any` +Data type: `String` @@ -989,7 +989,7 @@ Default value: `512` ##### `nginx_cfg_prepend` -Data type: `Any` +Data type: `Variant[Boolean,Array,Hash]` @@ -1085,7 +1085,7 @@ Default value: `undef` ##### `proxy_connect_timeout` -Data type: `Any` +Data type: `String` @@ -1109,7 +1109,7 @@ Default value: `undef` ##### `proxy_read_timeout` -Data type: `Any` +Data type: `String` @@ -1117,7 +1117,7 @@ Default value: `'90s'` ##### `proxy_redirect` -Data type: `Any` +Data type: `Optional[String]` @@ -1125,7 +1125,7 @@ Default value: `undef` ##### `proxy_send_timeout` -Data type: `Any` +Data type: `String` @@ -1256,7 +1256,7 @@ Default value: `true` ##### `types_hash_bucket_size` -Data type: `Any` +Data type: `Variant[Integer,String]` @@ -1264,7 +1264,7 @@ Default value: `'512'` ##### `types_hash_max_size` -Data type: `Any` +Data type: `Variant[Integer,String]` @@ -1432,7 +1432,7 @@ Default value: `undef` ##### `package_ensure` -Data type: `Any` +Data type: `String` @@ -1440,7 +1440,7 @@ Default value: `installed` ##### `package_name` -Data type: `Any` +Data type: `String` @@ -1448,7 +1448,7 @@ Default value: `$nginx::params::package_name` ##### `package_source` -Data type: `Any` +Data type: `String` @@ -1456,7 +1456,7 @@ Default value: `'nginx'` ##### `package_flavor` -Data type: `Any` +Data type: `Optional[String]` @@ -1496,7 +1496,7 @@ Default value: `undef` ##### `passenger_package_ensure` -Data type: `Any` +Data type: `String` @@ -1528,7 +1528,7 @@ Default value: `true` ##### `service_flags` -Data type: `Any` +Data type: `Optional[String]` @@ -1536,7 +1536,7 @@ Default value: `undef` ##### `service_restart` -Data type: `Any` +Data type: `Optional[String]` @@ -1544,7 +1544,7 @@ Default value: `undef` ##### `service_name` -Data type: `Any` +Data type: `String` @@ -1552,7 +1552,7 @@ Default value: `'nginx'` ##### `service_manage` -Data type: `Any` +Data type: `Boolean` diff --git a/manifests/init.pp b/manifests/init.pp index b8e46dc4c..d9f45e412 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -88,12 +88,12 @@ ### START Nginx Configuration ### Optional[Enum['on', 'off']] $absolute_redirect = undef, Enum['on', 'off'] $accept_mutex = 'on', - $accept_mutex_delay = '500ms', - $client_body_buffer_size = '128k', + String $accept_mutex_delay = '500ms', + String $client_body_buffer_size = '128k', String $client_max_body_size = '10m', - $client_body_timeout = '60s', - $send_timeout = '60s', - $lingering_timeout = '5s', + String $client_body_timeout = '60s', + String $send_timeout = '60s', + String $lingering_timeout = '5s', Optional[Enum['on','off','always']] $lingering_close = undef, Optional[String[1]] $lingering_time = undef, Optional[Enum['on', 'off']] $etag = undef, @@ -107,13 +107,13 @@ Optional[String] $fastcgi_cache_path = undef, Optional[String] $fastcgi_cache_use_stale = undef, Enum['on', 'off'] $gzip = 'off', - $gzip_buffers = undef, - $gzip_comp_level = 1, - $gzip_disable = 'msie6', - $gzip_min_length = 20, - $gzip_http_version = 1.1, + Optional[String] $gzip_buffers = undef, + Integer $gzip_comp_level = 1, + String $gzip_disable = 'msie6', + Integer $gzip_min_length = 20, + Float $gzip_http_version = 1.1, Nginx::GzipProxied $gzip_proxied = 'off', - $gzip_types = undef, + Optional[Variant[String[1],Array[String[1]]]] $gzip_types = undef, Enum['on', 'off'] $gzip_vary = 'off', Optional[Enum['on', 'off', 'always']] $gzip_static = undef, Optional[Variant[Hash, Array]] $http_cfg_prepend = undef, @@ -122,8 +122,8 @@ Optional[Variant[Array[String], String]] $http_raw_append = undef, Enum['on', 'off'] $http_tcp_nodelay = 'on', Enum['on', 'off'] $http_tcp_nopush = 'off', - $keepalive_timeout = '65s', - $keepalive_requests = '100', + String $keepalive_timeout = '65s', + String $keepalive_requests = '100', Hash[String[1], Nginx::LogFormat] $log_format = {}, Hash[String[1], Nginx::LogFormat] $stream_log_format = {}, Boolean $mail = false, @@ -134,7 +134,7 @@ String $multi_accept = 'off', Integer $names_hash_bucket_size = 64, Integer $names_hash_max_size = 512, - $nginx_cfg_prepend = false, + Variant[Boolean,Array,Hash] $nginx_cfg_prepend = false, String $proxy_buffers = '32 4k', String $proxy_buffer_size = '8k', String $proxy_cache_inactive = '20m', @@ -146,12 +146,12 @@ Optional[String] $proxy_cache_loader_sleep = undef, Optional[String] $proxy_cache_loader_threshold = undef, Optional[Enum['on', 'off']] $proxy_use_temp_path = undef, - $proxy_connect_timeout = '90s', + String $proxy_connect_timeout = '90s', Integer $proxy_headers_hash_bucket_size = 64, Optional[String] $proxy_http_version = undef, - $proxy_read_timeout = '90s', - $proxy_redirect = undef, - $proxy_send_timeout = '90s', + String $proxy_read_timeout = '90s', + Optional[String] $proxy_redirect = undef, + String $proxy_send_timeout = '90s', Array $proxy_set_header = [ 'Host $host', 'X-Real-IP $remote_addr', @@ -173,8 +173,8 @@ Enum['on', 'off'] $ssl_stapling_verify = 'off', Stdlib::Absolutepath $snippets_dir = $nginx::params::snippets_dir, Boolean $manage_snippets_dir = true, - $types_hash_bucket_size = '512', - $types_hash_max_size = '1024', + Variant[Integer,String] $types_hash_bucket_size = '512', + Variant[Integer,String] $types_hash_max_size = '1024', Integer $worker_connections = 1024, Enum['on', 'off'] $ssl_prefer_server_ciphers = 'on', Variant[Integer, Enum['auto']] $worker_processes = 'auto', @@ -198,15 +198,15 @@ Optional[Enum['on', 'off']] $reset_timedout_connection = undef, ### START Package Configuration ### - $package_ensure = installed, - $package_name = $nginx::params::package_name, - $package_source = 'nginx', - $package_flavor = undef, + String $package_ensure = installed, + String $package_name = $nginx::params::package_name, + String $package_source = 'nginx', + Optional[String] $package_flavor = undef, Boolean $manage_repo = $nginx::params::manage_repo, Hash[String[1], String[1]] $mime_types = $nginx::params::mime_types, Boolean $mime_types_preserve_defaults = false, Optional[String] $repo_release = undef, - $passenger_package_ensure = installed, + String $passenger_package_ensure = installed, String[1] $passenger_package_name = $nginx::params::passenger_package_name, Optional[Stdlib::HTTPUrl] $repo_source = undef, ### END Package Configuration ### @@ -214,10 +214,10 @@ ### START Service Configuation ### Stdlib::Ensure::Service $service_ensure = 'running', Boolean $service_enable = true, - $service_flags = undef, - $service_restart = undef, - $service_name = 'nginx', - $service_manage = true, + Optional[String] $service_flags = undef, + Optional[String] $service_restart = undef, + String $service_name = 'nginx', + Boolean $service_manage = true, Boolean $service_config_check = false, String $service_config_check_command = 'nginx -t', ### END Service Configuration ### From 92aa72c68072c4e221bbe803e5a6dac03d6d7318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Wed, 5 Jul 2023 08:55:43 -1000 Subject: [PATCH 2/5] Prefer usage of Nginx::Size and Nginx::Time over String --- manifests/init.pp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index d9f45e412..94d10fb87 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -88,22 +88,22 @@ ### START Nginx Configuration ### Optional[Enum['on', 'off']] $absolute_redirect = undef, Enum['on', 'off'] $accept_mutex = 'on', - String $accept_mutex_delay = '500ms', - String $client_body_buffer_size = '128k', - String $client_max_body_size = '10m', - String $client_body_timeout = '60s', - String $send_timeout = '60s', - String $lingering_timeout = '5s', + Nginx::Time $accept_mutex_delay = '500ms', + Nginx::Size $client_body_buffer_size = '128k', + Nginx::Size $client_max_body_size = '10m', + Nginx::Time $client_body_timeout = '60s', + Nginx::Time $send_timeout = '60s', + Nginx::Time $lingering_timeout = '5s', Optional[Enum['on','off','always']] $lingering_close = undef, Optional[String[1]] $lingering_time = undef, Optional[Enum['on', 'off']] $etag = undef, Optional[String] $events_use = undef, Array[Nginx::DebugConnection] $debug_connections = [], - String $fastcgi_cache_inactive = '20m', + Nginx::Time $fastcgi_cache_inactive = '20m', Optional[String] $fastcgi_cache_key = undef, String $fastcgi_cache_keys_zone = 'd3:100m', String $fastcgi_cache_levels = '1', - String $fastcgi_cache_max_size = '500m', + Nginx::Size $fastcgi_cache_max_size = '500m', Optional[String] $fastcgi_cache_path = undef, Optional[String] $fastcgi_cache_use_stale = undef, Enum['on', 'off'] $gzip = 'off', @@ -122,7 +122,7 @@ Optional[Variant[Array[String], String]] $http_raw_append = undef, Enum['on', 'off'] $http_tcp_nodelay = 'on', Enum['on', 'off'] $http_tcp_nopush = 'off', - String $keepalive_timeout = '65s', + Nginx::Time $keepalive_timeout = '65s', String $keepalive_requests = '100', Hash[String[1], Nginx::LogFormat] $log_format = {}, Hash[String[1], Nginx::LogFormat] $stream_log_format = {}, @@ -136,22 +136,22 @@ Integer $names_hash_max_size = 512, Variant[Boolean,Array,Hash] $nginx_cfg_prepend = false, String $proxy_buffers = '32 4k', - String $proxy_buffer_size = '8k', - String $proxy_cache_inactive = '20m', + Nginx::Size $proxy_buffer_size = '8k', + Nginx::Time $proxy_cache_inactive = '20m', String $proxy_cache_keys_zone = 'd2:100m', String $proxy_cache_levels = '1', - String $proxy_cache_max_size = '500m', + Nginx::Size $proxy_cache_max_size = '500m', Optional[Variant[Hash, String]] $proxy_cache_path = undef, Optional[Integer] $proxy_cache_loader_files = undef, Optional[String] $proxy_cache_loader_sleep = undef, Optional[String] $proxy_cache_loader_threshold = undef, Optional[Enum['on', 'off']] $proxy_use_temp_path = undef, - String $proxy_connect_timeout = '90s', + Nginx::Time $proxy_connect_timeout = '90s', Integer $proxy_headers_hash_bucket_size = 64, Optional[String] $proxy_http_version = undef, - String $proxy_read_timeout = '90s', + Nginx::Time $proxy_read_timeout = '90s', Optional[String] $proxy_redirect = undef, - String $proxy_send_timeout = '90s', + Nginx::Time $proxy_send_timeout = '90s', Array $proxy_set_header = [ 'Host $host', 'X-Real-IP $remote_addr', @@ -185,7 +185,7 @@ Optional[Stdlib::Unixpath] $ssl_dhparam = undef, Optional[String] $ssl_ecdh_curve = undef, String $ssl_session_cache = 'shared:SSL:10m', - String $ssl_session_timeout = '5m', + Nginx::Time $ssl_session_timeout = '5m', Optional[Enum['on', 'off']] $ssl_session_tickets = undef, Optional[Stdlib::Absolutepath] $ssl_session_ticket_key = undef, Optional[String] $ssl_buffer_size = undef, From 89496d2bbdf7197ff9f32dc011b6ed8af4ddad88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Wed, 5 Jul 2023 08:56:18 -1000 Subject: [PATCH 3/5] Extend supported values for Nginx::Size and Nginx::Time Allow raw integers and add support for combination of multiple units. --- spec/type_aliases/size_spec.rb | 10 ++++++++-- spec/type_aliases/time_spec.rb | 11 +++++++++-- types/size.pp | 5 ++++- types/time.pp | 5 ++++- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/spec/type_aliases/size_spec.rb b/spec/type_aliases/size_spec.rb index ea04586d2..daccca492 100644 --- a/spec/type_aliases/size_spec.rb +++ b/spec/type_aliases/size_spec.rb @@ -7,11 +7,17 @@ it { is_expected.to allow_value('1024K') } it { is_expected.to allow_value('1m') } it { is_expected.to allow_value('1M') } + it { is_expected.to allow_value(1) } + it { is_expected.to allow_value(1024) } + it { is_expected.to allow_value('1') } + it { is_expected.to allow_value('1024') } it { is_expected.not_to allow_value(:undef) } - it { is_expected.not_to allow_value(1) } - it { is_expected.not_to allow_value(1024) } it { is_expected.not_to allow_value('') } + it { is_expected.not_to allow_value(-1) } + it { is_expected.not_to allow_value(-1024) } + it { is_expected.not_to allow_value('-1') } + it { is_expected.not_to allow_value('-1024') } it { is_expected.not_to allow_value('0.1k') } it { is_expected.not_to allow_value('0.1K') } it { is_expected.not_to allow_value('0.1m') } diff --git a/spec/type_aliases/time_spec.rb b/spec/type_aliases/time_spec.rb index e2ac85b0f..210dd489a 100644 --- a/spec/type_aliases/time_spec.rb +++ b/spec/type_aliases/time_spec.rb @@ -10,10 +10,17 @@ it { is_expected.to allow_value('1d') } it { is_expected.to allow_value('1M') } it { is_expected.to allow_value('1y') } + it { is_expected.to allow_value('1y 2M 3w 4d 5h 6m 7ms') } + it { is_expected.to allow_value(1) } + it { is_expected.to allow_value(10) } + it { is_expected.to allow_value('1') } + it { is_expected.to allow_value('10') } it { is_expected.not_to allow_value(:undef) } - it { is_expected.not_to allow_value(1) } - it { is_expected.not_to allow_value(10) } + it { is_expected.not_to allow_value(-1) } + it { is_expected.not_to allow_value(-10) } + it { is_expected.not_to allow_value('-1') } + it { is_expected.not_to allow_value('-10') } it { is_expected.not_to allow_value('') } it { is_expected.not_to allow_value('10S') } it { is_expected.not_to allow_value('10.0s') } diff --git a/types/size.pp b/types/size.pp index 580476686..3a1b421f2 100644 --- a/types/size.pp +++ b/types/size.pp @@ -1 +1,4 @@ -type Nginx::Size = Pattern[/^\d+[k|K|m|M]?$/] +type Nginx::Size = Variant[ + Integer[0], + Pattern[/\A\d+[k|K|m|M]?\z/], +] diff --git a/types/time.pp b/types/time.pp index f6c24edc8..7b68b950d 100644 --- a/types/time.pp +++ b/types/time.pp @@ -1 +1,4 @@ -type Nginx::Time = Pattern[/^\d+(ms|s|m|h|d|w|M|y)?$/] +type Nginx::Time = Variant[ + Integer[0], + Pattern[/^(?!$)((\d+y *)?(\d+M *)?(\d+w *)?(\d+d *)?(\d+h *)?(\d+m *)?(\d+s *)?(\d+ms)?|\d+)$/], +] From d27b04c5be2ed17d79edaf62dd70b2213b397f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Wed, 5 Jul 2023 10:31:08 -1000 Subject: [PATCH 4/5] Regenerate REFERENCE.md --- REFERENCE.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 5412b5cde..ff104ab7f 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -629,7 +629,7 @@ Default value: `'on'` ##### `accept_mutex_delay` -Data type: `String` +Data type: `Nginx::Time` @@ -637,7 +637,7 @@ Default value: `'500ms'` ##### `client_body_buffer_size` -Data type: `String` +Data type: `Nginx::Size` @@ -645,7 +645,7 @@ Default value: `'128k'` ##### `client_max_body_size` -Data type: `String` +Data type: `Nginx::Size` @@ -653,7 +653,7 @@ Default value: `'10m'` ##### `client_body_timeout` -Data type: `String` +Data type: `Nginx::Time` @@ -661,7 +661,7 @@ Default value: `'60s'` ##### `send_timeout` -Data type: `String` +Data type: `Nginx::Time` @@ -669,7 +669,7 @@ Default value: `'60s'` ##### `lingering_timeout` -Data type: `String` +Data type: `Nginx::Time` @@ -709,7 +709,7 @@ Default value: `undef` ##### `fastcgi_cache_inactive` -Data type: `String` +Data type: `Nginx::Time` @@ -741,7 +741,7 @@ Default value: `'1'` ##### `fastcgi_cache_max_size` -Data type: `String` +Data type: `Nginx::Size` @@ -893,7 +893,7 @@ Default value: `'off'` ##### `keepalive_timeout` -Data type: `String` +Data type: `Nginx::Time` @@ -1005,7 +1005,7 @@ Default value: `'32 4k'` ##### `proxy_buffer_size` -Data type: `String` +Data type: `Nginx::Size` @@ -1013,7 +1013,7 @@ Default value: `'8k'` ##### `proxy_cache_inactive` -Data type: `String` +Data type: `Nginx::Time` @@ -1037,7 +1037,7 @@ Default value: `'1'` ##### `proxy_cache_max_size` -Data type: `String` +Data type: `Nginx::Size` @@ -1085,7 +1085,7 @@ Default value: `undef` ##### `proxy_connect_timeout` -Data type: `String` +Data type: `Nginx::Time` @@ -1109,7 +1109,7 @@ Default value: `undef` ##### `proxy_read_timeout` -Data type: `String` +Data type: `Nginx::Time` @@ -1125,7 +1125,7 @@ Default value: `undef` ##### `proxy_send_timeout` -Data type: `String` +Data type: `Nginx::Time` @@ -1352,7 +1352,7 @@ Default value: `'shared:SSL:10m'` ##### `ssl_session_timeout` -Data type: `String` +Data type: `Nginx::Time` @@ -5171,13 +5171,13 @@ Variant[String[1], Struct[{ The Nginx::Size data type. -Alias of `Pattern[/^\d+[k|K|m|M]?$/]` +Alias of `Variant[Integer[0], Pattern[/\A\d+[k|K|m|M]?\z/]]` ### `Nginx::Time` The Nginx::Time data type. -Alias of `Pattern[/^\d+(ms|s|m|h|d|w|M|y)?$/]` +Alias of `Variant[Integer[0], Pattern[/^(?!$)((\d+y *)?(\d+M *)?(\d+w *)?(\d+d *)?(\d+h *)?(\d+m *)?(\d+s *)?(\d+ms)?|\d+)$/]]` ### `Nginx::UpstreamCustomParameters` From 4b1a9320a0951adc033ee122499803956e1d7704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Wed, 5 Jul 2023 11:11:14 -1000 Subject: [PATCH 5/5] Fix incorrect data types Some parameter data types are not great and deserve to be changed. Use Variant to allow both the old and new data types, but emit a deprecation warning if the legacy data type is used. A future backward-incompatible PR will remove these legacy data-types and the deprecation warnings. --- REFERENCE.md | 8 ++++---- manifests/init.pp | 11 +++++++++-- spec/classes/nginx_spec.rb | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index ff104ab7f..8188c1057 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -805,11 +805,11 @@ Default value: `20` ##### `gzip_http_version` -Data type: `Float` +Data type: `Variant[Enum['1.0','1.1'], Float]` -Default value: `1.1` +Default value: `'1.1'` ##### `gzip_proxied` @@ -901,11 +901,11 @@ Default value: `'65s'` ##### `keepalive_requests` -Data type: `String` +Data type: `Variant[Integer, String]` -Default value: `'100'` +Default value: `100` ##### `log_format` diff --git a/manifests/init.pp b/manifests/init.pp index 94d10fb87..f78afd2e5 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -111,7 +111,7 @@ Integer $gzip_comp_level = 1, String $gzip_disable = 'msie6', Integer $gzip_min_length = 20, - Float $gzip_http_version = 1.1, + Variant[Enum['1.0','1.1'], Float] $gzip_http_version = '1.1', Nginx::GzipProxied $gzip_proxied = 'off', Optional[Variant[String[1],Array[String[1]]]] $gzip_types = undef, Enum['on', 'off'] $gzip_vary = 'off', @@ -123,7 +123,7 @@ Enum['on', 'off'] $http_tcp_nodelay = 'on', Enum['on', 'off'] $http_tcp_nopush = 'off', Nginx::Time $keepalive_timeout = '65s', - String $keepalive_requests = '100', + Variant[Integer, String] $keepalive_requests = 100, Hash[String[1], Nginx::LogFormat] $log_format = {}, Hash[String[1], Nginx::LogFormat] $stream_log_format = {}, Boolean $mail = false, @@ -244,6 +244,13 @@ ### END Hiera Lookups ### ) inherits nginx::params { + if $gzip_http_version =~ Float { + deprecation('gzip_http_version', 'Passing a Float is deprecated, please pass a String') + } + if $keepalive_requests =~ String { + deprecation('keepalive_requests', 'Passing a String is deprecated, please pass a Integer') + } + contain 'nginx::package' contain 'nginx::config' contain 'nginx::service' diff --git a/spec/classes/nginx_spec.rb b/spec/classes/nginx_spec.rb index dd9aec234..ae70a3f08 100644 --- a/spec/classes/nginx_spec.rb +++ b/spec/classes/nginx_spec.rb @@ -674,7 +674,7 @@ { title: 'should set keepalive_requests', attr: 'keepalive_requests', - value: '345', + value: 345, match: ' keepalive_requests 345;' }, {