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

Added nginx::resource::mailhost to be configured via hiera #293

Merged
merged 1 commit into from
Apr 11, 2014
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
7 changes: 7 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ nginx::nginx_locations:
location: /userContent
vhost: www.puppetlabs.com
www_root: /var/www/html
nginx::nginx_mailhosts:
'smtp':
auth_http: server2.example/cgi-bin/auth
protocol: smtp
listen_port: 587
ssl_port: 465
starttls: only
```

## Nginx with precompiled Passenger
Expand Down
3 changes: 3 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
$nginx_vhosts = {},
$nginx_upstreams = {},
$nginx_locations = {},
$nginx_mailhosts = {},
$manage_repo = $nginx::params::manage_repo,
) inherits nginx::params {

Expand Down Expand Up @@ -115,6 +116,7 @@
validate_hash($nginx_upstreams)
validate_hash($nginx_vhosts)
validate_hash($nginx_locations)
validate_hash($nginx_mailhosts)
validate_bool($manage_repo)

class { 'nginx::package':
Expand Down Expand Up @@ -161,6 +163,7 @@
create_resources('nginx::resource::upstream', $nginx_upstreams)
create_resources('nginx::resource::vhost', $nginx_vhosts)
create_resources('nginx::resource::location', $nginx_locations)
create_resources('nginx::resource::mailhost', $nginx_mailhosts)

# Allow the end user to establish relationships to the "main" class
# and preserve the relationship to the implementation classes through
Expand Down
4 changes: 3 additions & 1 deletion spec/classes/nginx_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
{
:nginx_upstreams => { 'upstream1' => { 'members' => ['localhost:3000']} },
:nginx_vhosts => { 'test2.local' => { 'www_root' => '/' } },
:nginx_locations => { 'test2.local' => { 'vhost' => 'test2.local', 'www_root' => '/'} }
:nginx_locations => { 'test2.local' => { 'vhost' => 'test2.local', 'www_root' => '/'} },
:nginx_mailhosts => { 'smtp.test2.local' => { 'auth_http' => 'server2.example/cgi-bin/auth', 'protocol' => 'smtp', 'listen_port' => 587} }
}
end

Expand All @@ -23,6 +24,7 @@
it { should contain_nginx__resource__upstream("upstream1") }
it { should contain_nginx__resource__vhost("test2.local") }
it { should contain_nginx__resource__location("test2.local") }
it { should contain_nginx__resource__mailhost("smtp.test2.local") }
end

context "Debian OS" do
Expand Down