Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix streamhost support #933

Merged
merged 1 commit into from
Oct 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
$keepalive_requests = '100',
$log_format = {},
$mail = false,
$stream = false,
$multi_accept = 'off',
$names_hash_bucket_size = '64',
$names_hash_max_size = '512',
Expand Down Expand Up @@ -174,6 +175,7 @@
}

validate_bool($mail)
validate_bool($stream)
validate_string($server_tokens)
validate_string($client_max_body_size)
if (!is_integer($names_hash_bucket_size)) {
Expand Down Expand Up @@ -300,6 +302,7 @@
recurse => true,
}
}
# No real reason not to make these even if $stream is not enabled.
file { "${conf_dir}/streams-enabled":
ensure => directory,
owner => $sites_available_owner,
Expand All @@ -309,7 +312,7 @@
file { "${conf_dir}/streams-available":
ensure => directory,
}
if $vhost_purge == true {
if $vhost_purge {
File["${conf_dir}/streams-enabled"] {
purge => true,
recurse => true,
Expand Down
3 changes: 3 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
$keepalive_timeout = undef,
$keepalive_requests = undef,
$mail = undef,
$stream = undef,
$multi_accept = undef,
$names_hash_bucket_size = undef,
$names_hash_max_size = undef,
Expand Down Expand Up @@ -172,6 +173,7 @@
$logdir or
$log_format or
$mail or
$stream or
$multi_accept or
$names_hash_bucket_size or
$names_hash_max_size or
Expand Down Expand Up @@ -259,6 +261,7 @@
log_dir => $logdir,
log_format => $log_format,
mail => $mail,
stream => $stream,
multi_accept => $multi_accept,
names_hash_bucket_size => $names_hash_bucket_size,
names_hash_max_size => $names_hash_max_size,
Expand Down
4 changes: 0 additions & 4 deletions manifests/resource/streamhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
# of 90 seconds
# [*resolver*] - Array: Configures name servers used to resolve
# names of upstream servers into addresses.
# [*server_name*] - List of streamhost names for which this streamhost will
# respond. Default [$name].
# [*raw_prepend*] - A single string, or an array of strings to
# prepend to the server directive (after cfg prepend directives). NOTE:
# YOU are responsible for a semicolon on each line that requires one.
Expand Down Expand Up @@ -61,7 +59,6 @@
$proxy_read_timeout = $::nginx::config::proxy_read_timeout,
$proxy_connect_timeout = $::nginx::config::proxy_connect_timeout,
$resolver = [],
$server_name = [$name],
$raw_prepend = undef,
$raw_append = undef,
$owner = $::nginx::config::global_owner,
Expand Down Expand Up @@ -98,7 +95,6 @@
validate_string($proxy_read_timeout)

validate_array($resolver)
validate_array($server_name)

validate_string($owner)
validate_string($group)
Expand Down
6 changes: 0 additions & 6 deletions spec/defines/resource_stream_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,6 @@
value: 'spdy',
match: %r{\s+listen\s+\[::\]:80 spdy;}
},
{
title: 'should set servername(s)',
attr: 'server_name',
value: ['www.foo.com', 'foo.com'],
match: %r{\s+server_name\s+www.foo.com foo.com;}
},
{
title: 'should contain raw_prepend directives',
attr: 'raw_prepend',
Expand Down
4 changes: 4 additions & 0 deletions templates/conf.d/nginx.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ mail {
<% end -%>
<% if @stream -%>
stream {
<%-# conf.stream.d gets included either way if $stream is enabled -%>
include <%= @conf_dir %>/conf.stream.d/*.conf;
<% unless @confd_only -%>
include <%= @conf_dir %>/streams-enabled/*;
<% end -%>
}
<% end -%>
1 change: 0 additions & 1 deletion templates/streamhost/streamhost.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ server {
listen [<%= @ipv6_listen_ip %>]:<%= @ipv6_listen_port %> <% if @ipv6_listen_options %><%= @ipv6_listen_options %><% end %>;
<%- end -%>
<%- end -%>
server_name <%= @server_name.join(" ") %>;

<% Array(@raw_prepend).each do |line| -%>
<%= line %>
Expand Down