(#14450) Fix dashboard::passenger issues
Previously when passenger was set to true the pasenger class would error. This commit fixes those problems and cleans up the template to use the apache_name parameter.
This commit is contained in:
parent
d2a1c49f4a
commit
37e013bfa2
@ -151,7 +151,7 @@ class dashboard (
|
||||
|
||||
file { '/etc/logrotate.d/puppet-dashboard':
|
||||
ensure => present,
|
||||
content => template('dashboard/puppet-dashboard.logrotate.erb'),
|
||||
content => template('dashboard/logrotate.erb'),
|
||||
owner => '0',
|
||||
group => '0',
|
||||
mode => '0644',
|
||||
|
@ -15,15 +15,12 @@
|
||||
class dashboard::passenger (
|
||||
$dashboard_site,
|
||||
$dashboard_port,
|
||||
$dashboard_config = $dashboard::params::dashboard_config
|
||||
$dashboard_config = $dashboard::params::dashboard_config,
|
||||
$dashboard_root = $dashboard::params::dashboard_root,
|
||||
) inherits dashboard {
|
||||
|
||||
Class ['::passenger']
|
||||
-> Apache::Vhost[$dashboard_site]
|
||||
|
||||
class { '::passenger':
|
||||
port => $dashboard_port,
|
||||
}
|
||||
include apache
|
||||
include passenger
|
||||
|
||||
file { '/etc/init.d/puppet-dashboard':
|
||||
ensure => absent,
|
||||
@ -35,10 +32,10 @@ class dashboard::passenger (
|
||||
}
|
||||
|
||||
apache::vhost { $dashboard_site:
|
||||
port => '8080',
|
||||
port => $dashboard_port,
|
||||
priority => '50',
|
||||
docroot => '/usr/share/puppet-dashboard/public',
|
||||
template => 'dashboard/puppet-dashboard-passenger-vhost.erb',
|
||||
docroot => "${dashboard_root}/public",
|
||||
template => 'dashboard/passenger-vhost.erb',
|
||||
}
|
||||
|
||||
}
|
||||
|
18
templates/passenger-vhost.erb
Normal file
18
templates/passenger-vhost.erb
Normal file
@ -0,0 +1,18 @@
|
||||
Listen <%= scope.lookupvar("dashboard::params::dashboard_port") %>
|
||||
|
||||
<VirtualHost *:<%= scope.lookupvar("dashboard::params::dashboard_port") %>>
|
||||
ServerName <%= name %>
|
||||
DocumentRoot <%= docroot %>
|
||||
RailsBaseURI <%= rails_base_uri %>
|
||||
<Directory <%= docroot %>>
|
||||
Options None
|
||||
AllowOverride AuthConfig
|
||||
Order allow,deny
|
||||
allow from all
|
||||
</Directory>
|
||||
ErrorLog /var/log/<%= scope.lookupvar("apache::params::apache_name") %>/<%= name %>_error.log
|
||||
LogLevel warn
|
||||
CustomLog /var/log/<%= scope.lookupvar("apache::params::apache_name") %>/<%= name %>_access.log combined
|
||||
ServerSignature On
|
||||
</VirtualHost>
|
||||
|
@ -1,34 +0,0 @@
|
||||
Listen <%= 8080 %>
|
||||
|
||||
<VirtualHost *:<%= dashboard_port %>>
|
||||
ServerName <%= name %>
|
||||
DocumentRoot <%= docroot %>
|
||||
RailsBaseURI <%= rails_base_uri %>
|
||||
<Directory <%= docroot %>>
|
||||
Options None
|
||||
AllowOverride AuthConfig
|
||||
Order allow,deny
|
||||
allow from all
|
||||
</Directory>
|
||||
# <Location "/">
|
||||
# Order allow,deny
|
||||
# Allow from <%= ipaddress %>
|
||||
# Satisfy any
|
||||
# AuthName "Puppet Dashboard"
|
||||
# AuthType Basic
|
||||
# AuthUserFile /etc/apache2/htpasswd
|
||||
# require valid-user
|
||||
# AllowOverride AuthConfig
|
||||
# </Location>
|
||||
<% case operatingsystem
|
||||
when 'Debian', 'Ubuntu'
|
||||
apachename = 'apache2'
|
||||
else
|
||||
apachename = 'httpd'
|
||||
end -%>
|
||||
ErrorLog /var/log/<%= apachename %>/<%= name %>_error.log
|
||||
LogLevel warn
|
||||
CustomLog /var/log/<%= apachename %>/<%= name %>_access.log combined
|
||||
ServerSignature On
|
||||
</VirtualHost>
|
||||
|
@ -7,12 +7,10 @@ node default {
|
||||
dashboard_password => 'changeme',
|
||||
dashboard_db => 'dashboard_prod',
|
||||
dashboard_charset => 'utf8',
|
||||
dashboard_site => $fqdn,
|
||||
dashboard_port => '8080',
|
||||
dashboard_site => $::fqdn,
|
||||
dashboard_port => '8081',
|
||||
mysql_root_pw => 'changemetoo',
|
||||
passenger => true,
|
||||
mysql_package_provider => 'yum',
|
||||
ruby_mysql_package => 'ruby-mysql',
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user