Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
C24-AK committed Oct 24, 2023
1 parent a6cab7e commit 95183d0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 43 deletions.
7 changes: 1 addition & 6 deletions spec/acceptance/nginx_location_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@
describe 'nginx::resource::location define:' do
it 'runs successfully' do
pp = "
class { 'nginx':
nginx_version => '1.25.2',
package_ensure => latest,
package_source => 'nginx-mainline',
manage_repo => true,
}
class { 'nginx': }
nginx::resource::server { 'www.puppetlabs.com':
ensure => present,
www_root => '/var/www/www.puppetlabs.com',
Expand Down
6 changes: 1 addition & 5 deletions spec/acceptance/nginx_mail_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@
class { 'nginx':
mail => true,
nginx_version => '1.25.2',
package_ensure => latest,
package_source => 'nginx-mainline',
manage_repo => true,
dynamic_modules => fact('os.family') ? {
'RedHat' => ['/usr/lib64/nginx/modules/ngx_mail_module.so'],
default => [],
Expand All @@ -63,7 +59,7 @@ class { 'nginx':
}
"

apply_manifest(pp, catch_failures: true, debug: true, trace: true)
apply_manifest(pp, catch_failures: true)
# The module produce different config when nginx is installed and when it
# is not installed prior to getting facts, so we need to re-apply the
# catalog.
Expand Down
30 changes: 4 additions & 26 deletions spec/acceptance/nginx_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@
context 'new server on port 80' do
it 'configures a nginx server' do
pp = "
class { 'nginx':
nginx_version => '1.25.2',
package_ensure => latest,
package_source => 'nginx-mainline',
manage_repo => true,
}
class { 'nginx': }
nginx::resource::server { 'www.puppetlabs.com':
ensure => present,
www_root => '/var/www/www.puppetlabs.com',
Expand Down Expand Up @@ -62,12 +57,7 @@ class { 'nginx':

it 'configures a nginx SSL server' do
pp = "
class { 'nginx':
nginx_version => '1.25.2',
package_ensure => latest,
package_source => 'nginx-mainline',
manage_repo => true,
}
class { 'nginx': }
nginx::resource::server { 'www.puppetlabs.com':
ensure => present,
ssl => true,
Expand Down Expand Up @@ -132,16 +122,10 @@ class { 'nginx':
context 'should run successfully with encrypted ssl key' do
it 'configures a nginx SSL server' do
pp = "
class { 'nginx':
nginx_version => '1.25.2',
package_ensure => latest,
package_source => 'nginx-mainline',
manage_repo => true,
}
class { 'nginx': }
nginx::resource::server { 'www.puppetlabs.com':
ensure => present,
ssl => true,
http2 => 'on',
ssl_cache => 'shared:SSL:10m',
ssl_cert => '/etc/pki/tls/certs/crypted.cert',
ssl_key => '/etc/pki/tls/private/crypted.key',
Expand Down Expand Up @@ -188,16 +172,10 @@ class { 'nginx':
context 'should run successfully with ssl_redirect' do
it 'configures a nginx SSL server' do
pp = "
class { 'nginx':
nginx_version => '1.25.2',
package_ensure => latest,
package_source => 'nginx-mainline',
manage_repo => true,
}
class { 'nginx': }
nginx::resource::server { 'www.puppetlabs.com':
ensure => present,
ssl => true,
http2 => 'on',
ssl_cert => '/etc/pki/tls/certs/blah.cert',
ssl_key => '/etc/pki/tls/private/blah.key',
ssl_redirect => true,
Expand Down
8 changes: 4 additions & 4 deletions templates/server/server_ssl_header.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ server {
<%- if @listen_ip.is_a?(Array) then -%>
<%- @listen_ip.each do |ip| -%>
listen <%= ip %>:<%= @ssl_port %> <% if @ssl_listen_option %>ssl<% end %><% if @spdy == 'on' %> spdy<% end %><% if @listen_options %> <%= @listen_options %><% end %>;
<% if @http2 %>http2 <%= @http2 %>;<% end %>
<% if scope.call_function('versioncmp', [scope['nginx::nginx_version'], '1.25.1']) < 0 && @http2 -%>http2 <%= @http2 %>;<% end %>
<%- end -%>
<%- else -%>
listen <%= @listen_ip %>:<%= @ssl_port %> <% if @ssl_listen_option %>ssl<% end %><% if @spdy == 'on' %> spdy<% end %><% if @listen_options %> <%= @listen_options %><% end %>;
<% if @http2 %>http2 <%= @http2 %>;<% end %>
<% if scope.call_function('versioncmp', [scope['nginx::nginx_version'], '1.25.1']) < 0 && @http2 -%>http2 <%= @http2 %>;<% end %>
<%- end -%>
<%= scope.function_template(["nginx/server/server_ssl_ipv6_listen.erb"]) %>
<%- if @rewrite_www_to_non_www -%>
Expand Down Expand Up @@ -51,11 +51,11 @@ server {
<%- if @listen_ip.is_a?(Array) then -%>
<%- @listen_ip.each do |ip| -%>
listen <%= ip %>:<%= @ssl_port %> <% if @ssl_listen_option %>ssl<% end %><% if @spdy == 'on' %> spdy<% end %><% if @listen_options %> <%= @listen_options %><% end %>;
<% if @http2 %>http2 <%= @http2 %>;<% end %>
<% if scope.call_function('versioncmp', [scope['nginx::nginx_version'], '1.25.1']) < 0 && @http2 -%>http2 <%= @http2 %>;<% end %>
<%- end -%>
<%- else -%>
listen <%= @listen_ip %>:<%= @ssl_port %> <% if @ssl_listen_option %>ssl<% end %><% if @spdy == 'on' %> spdy<% end %><% if @listen_options %> <%= @listen_options %><% end %>;
<% if @http2 %>http2 <%= @http2 %>;<% end %>
<% if scope.call_function('versioncmp', [scope['nginx::nginx_version'], '1.25.1']) < 0 && @http2 -%>http2 <%= @http2 %>;<% end %>
<%- end -%>
<%= scope.function_template(["nginx/server/server_ssl_ipv6_listen.erb"]) %>
<%- if @rewrite_www_to_non_www -%>
Expand Down
4 changes: 2 additions & 2 deletions templates/server/server_ssl_ipv6_listen.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<%- if @ipv6_listen_ip.is_a?(Array) then -%>
<%- @ipv6_listen_ip.each do |ipv6| -%>
listen [<%= ipv6 %>]:<%= @ssl_port %> ssl<% if @spdy == 'on' %> spdy<% end %><% if @ipv6_listen_options %> <%= @ipv6_listen_options %><% end %>;
<% if @http2 %>http2 <%= @http2 %>;<% end %>
<% if scope.call_function('versioncmp', [scope['nginx::nginx_version'], '1.25.1']) < 0 && @http2 -%>http2 <%= @http2 %>;<% end %>
<%- end -%>
<%- else -%>
listen [<%= @ipv6_listen_ip %>]:<%= @ssl_port %> ssl<% if @spdy == 'on' %> spdy<% end %><% if @ipv6_listen_options %> <%= @ipv6_listen_options %><% end %>;
<% if @http2 %>http2 <%= @http2 %>;<% end %>
<% if scope.call_function('versioncmp', [scope['nginx::nginx_version'], '1.25.1']) < 0 && @http2 -%>http2 <%= @http2 %>;<% end %>
<%- end -%>
<%- end -%>

0 comments on commit 95183d0

Please sign in to comment.