[FUEL-177] fix horizon ordering

This commit is contained in:
Vladimir Kuklin 2012-11-20 18:31:46 +04:00
parent 4d6ff4eb08
commit 1af0a91cd3
2 changed files with 37 additions and 31 deletions

View File

@ -87,10 +87,32 @@ class horizon(
content => "LoadModule wsgi_module modules/mod_wsgi.so\n",
require => Package["$::horizon::params::http_service", "$::horizon::params::http_modwsgi"],
before => Package["$::horizon::params::package_name"],
}
} # ensure there is a HTTP redirect from / to /dashboard
file_line { 'horizon_redirect_rule':
path => $::horizon::params::dashboard_config_file,
line => 'RedirectMatch permanent ^/$ /dashboard/',
require => Package["$::horizon::params::package_name"],
notify => Service["$::horizon::params::http_service"]
}
file_line { 'httpd_listen_on_internal_network_only':
path => $::horizon::params::httpd_listen_config_file,
match => '^Listen (.*)$',
line => "Listen ${bind_address}:80",
before => [Service["$::horizon::params::http_service"]],
notify => [Service["$::horizon::params::http_service"]],
require =>[Package["$::horizon::params::package_name"]]
}
}
'Debian': {
file {'/etc/apache2':
ensure => directory,
require => []
}
file { $::horizon::params::httpd_listen_config_file:
content => template('horizon/ports.conf.erb'),
require => File['/etc/apache2'],
before => Package[$::horizon::params::package_name],
}
exec { 'a2enmod wsgi':
command => 'a2enmod wsgi',
path => ['/usr/bin','/usr/sbin','/bin/','/sbin'],
@ -100,25 +122,8 @@ class horizon(
}
}
# ensure there is a HTTP redirect from / to /dashboard
file_line { 'horizon_redirect_rule':
path => $::horizon::params::dashboard_config_file,
line => 'RedirectMatch permanent ^/$ /dashboard/',
require => Package["$::horizon::params::package_name"],
notify => Service["$::horizon::params::http_service"]
}
# ensure https only listens on the management address, not on all interfaces
file_line { 'httpd_listen_on_internal_network_only':
path => $::horizon::params::httpd_listen_config_file,
match => '^Listen (.*)$',
line => "Listen ${bind_address}:80",
before => Service["$::horizon::params::http_service"],
require => Package["$::horizon::params::package_name"],
notify => Service["$::horizon::params::http_service"]
}
#case $::osfamily
# 'RedHat': {
service { '$::horizon::params::http_service':
name => $::horizon::params::http_service,
ensure => 'running',
@ -126,15 +131,4 @@ class horizon(
require => Package["$::horizon::params::http_service", "$::horizon::params::http_modwsgi"],
subscribe => File["$::horizon::params::local_settings_path", "$::horizon::params::logdir"]
}
# }
# 'Debian': {
# service { '$::horizon::params::http_service':
# name => $::horizon::params::http_service,
# ensure => 'running',
# enable => true,
# require => Package["$::horizon::params::http_service", "$::horizon::params::http_modwsgi"],
# subscribe => File["$::horizon::params::local_settings_path", "$::horizon::params::logdir"]
# }
# }
# }
}

View File

@ -0,0 +1,12 @@
NameVirtualHost *:80
Listen <%= bind_address %>:80
<IfModule mod_ssl.c>
Listen <%= bind_address %>:443
</IfModule>
<IfModule mod_gnutls.c>
Listen <%= bind_address %>:443
</IfModule>