Skip to content

Commit

Permalink
Merge pull request #852 from richm/bug/modules-1332
Browse files Browse the repository at this point in the history
(#MODULES-1332) set osfamily default for wsgi_socket_prefix
  • Loading branch information
Morgan Haskel committed Sep 26, 2014
2 parents 452a012 + 8d09ecd commit 3782afd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion manifests/mod/wsgi.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class apache::mod::wsgi (
$wsgi_socket_prefix = undef,
$wsgi_socket_prefix = $::apache::params::wsgi_socket_prefix,
$wsgi_python_path = undef,
$wsgi_python_home = undef,
){
Expand Down
7 changes: 7 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@
$fastcgi_lib_path = undef
$mime_support_package = 'mailcap'
$mime_types_config = '/etc/mime.types'
if $::osfamily == "RedHat" {
$wsgi_socket_prefix = '/var/run/wsgi'
} else {
$wsgi_socket_prefix = undef
}
} elsif $::osfamily == 'Debian' {
$user = 'www-data'
$group = 'www-data'
Expand Down Expand Up @@ -194,6 +199,7 @@
}
}
}
$wsgi_socket_prefix = undef
} elsif $::osfamily == 'FreeBSD' {
$user = 'www'
$group = 'www'
Expand Down Expand Up @@ -255,6 +261,7 @@
$fastcgi_lib_path = undef # TODO: revisit
$mime_support_package = 'misc/mime-support'
$mime_types_config = '/usr/local/etc/mime.types'
$wsgi_socket_prefix = undef
} else {
fail("Class['apache::params']: Unsupported osfamily: ${::osfamily}")
}
Expand Down
15 changes: 12 additions & 3 deletions spec/classes/mod/wsgi_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
}
end
it { is_expected.to contain_class("apache::params") }
it { is_expected.to contain_apache__mod('wsgi') }
it { is_expected.to contain_class('apache::mod::wsgi').with(
'wsgi_socket_prefix' => nil
)
}
it { is_expected.to contain_package("libapache2-mod-wsgi") }
end
context "on a RedHat OS" do
Expand All @@ -34,7 +37,10 @@
}
end
it { is_expected.to contain_class("apache::params") }
it { is_expected.to contain_apache__mod('wsgi') }
it { is_expected.to contain_class('apache::mod::wsgi').with(
'wsgi_socket_prefix' => '/var/run/wsgi'
)
}
it { is_expected.to contain_package("mod_wsgi") }

describe "with custom WSGISocketPrefix" do
Expand Down Expand Up @@ -63,7 +69,10 @@
}
end
it { is_expected.to contain_class("apache::params") }
it { is_expected.to contain_apache__mod('wsgi') }
it { is_expected.to contain_class('apache::mod::wsgi').with(
'wsgi_socket_prefix' => nil
)
}
it { is_expected.to contain_package("www/mod_wsgi") }
end
end

0 comments on commit 3782afd

Please sign in to comment.