Skip to content

Commit

Permalink
Merge pull request voxpupuli#1068 from cyon/feature/mailhosts_defaults
Browse files Browse the repository at this point in the history
Adds hiera nginx_mailhosts_defaults like nginx_servers_defaults
  • Loading branch information
vinzent authored Apr 11, 2017
2 parents 7aacdd4 + 0c01497 commit fc47cab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
$string_mappings = {},
$nginx_locations = {},
$nginx_mailhosts = {},
$nginx_mailhosts_defaults = {},
$nginx_streamhosts = {},
$nginx_upstreams = {},
$nginx_servers = {},
Expand All @@ -181,7 +182,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)
Expand Down
2 changes: 2 additions & 0 deletions spec/classes/nginx_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit fc47cab

Please sign in to comment.