From 0c01497bfeb7d64e6c3201d4cfbec54e1d709135 Mon Sep 17 00:00:00 2001 From: Dominic Luechinger Date: Tue, 11 Apr 2017 00:47:30 +0200 Subject: [PATCH] Adds hiera nginx_mailhosts_defaults like nginx_servers_defaults --- manifests/init.pp | 3 ++- spec/classes/nginx_spec.rb | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index cccd1b7dd..549bc97dc 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -155,6 +155,7 @@ $string_mappings = {}, $nginx_locations = {}, $nginx_mailhosts = {}, + $nginx_mailhosts_defaults = {}, $nginx_streamhosts = {}, $nginx_upstreams = {}, $nginx_servers = {}, @@ -180,7 +181,7 @@ create_resources('nginx::resource::upstream', $nginx_upstreams) create_resources('nginx::resource::server', $nginx_servers, $nginx_servers_defaults) create_resources('nginx::resource::location', $nginx_locations) - create_resources('nginx::resource::mailhost', $nginx_mailhosts) + create_resources('nginx::resource::mailhost', $nginx_mailhosts, $nginx_mailhosts_defaults) create_resources('nginx::resource::streamhost', $nginx_streamhosts) create_resources('nginx::resource::map', $string_mappings) create_resources('nginx::resource::geo', $geo_mappings) diff --git a/spec/classes/nginx_spec.rb b/spec/classes/nginx_spec.rb index 278680b0d..e587187ef 100644 --- a/spec/classes/nginx_spec.rb +++ b/spec/classes/nginx_spec.rb @@ -14,6 +14,7 @@ nginx_servers_defaults: { 'listen_options' => 'default_server' }, nginx_locations: { 'test2.local' => { 'server' => 'test2.local', 'www_root' => '/' } }, nginx_mailhosts: { 'smtp.test2.local' => { 'auth_http' => 'server2.example/cgi-bin/auth', 'protocol' => 'smtp', 'listen_port' => 587 } }, + nginx_mailhosts_defaults: { 'listen_options' => 'default_server_smtp' }, nginx_streamhosts: { 'streamhost1' => { 'proxy' => 'streamproxy' } } } end @@ -33,6 +34,7 @@ it { is_expected.to contain_nginx__resource__server('test2.local').with_listen_options('default_server') } it { is_expected.to contain_nginx__resource__location('test2.local') } it { is_expected.to contain_nginx__resource__mailhost('smtp.test2.local') } + it { is_expected.to contain_nginx__resource__mailhost('smtp.test2.local').with_listen_options('default_server_smtp') } it { is_expected.to contain_nginx__resource__streamhost('streamhost1').with_proxy('streamproxy') } end