(#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':
|
file { '/etc/logrotate.d/puppet-dashboard':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
content => template('dashboard/puppet-dashboard.logrotate.erb'),
|
content => template('dashboard/logrotate.erb'),
|
||||||
owner => '0',
|
owner => '0',
|
||||||
group => '0',
|
group => '0',
|
||||||
mode => '0644',
|
mode => '0644',
|
||||||
|
@ -15,15 +15,12 @@
|
|||||||
class dashboard::passenger (
|
class dashboard::passenger (
|
||||||
$dashboard_site,
|
$dashboard_site,
|
||||||
$dashboard_port,
|
$dashboard_port,
|
||||||
$dashboard_config = $dashboard::params::dashboard_config
|
$dashboard_config = $dashboard::params::dashboard_config,
|
||||||
|
$dashboard_root = $dashboard::params::dashboard_root,
|
||||||
) inherits dashboard {
|
) inherits dashboard {
|
||||||
|
|
||||||
Class ['::passenger']
|
include apache
|
||||||
-> Apache::Vhost[$dashboard_site]
|
include passenger
|
||||||
|
|
||||||
class { '::passenger':
|
|
||||||
port => $dashboard_port,
|
|
||||||
}
|
|
||||||
|
|
||||||
file { '/etc/init.d/puppet-dashboard':
|
file { '/etc/init.d/puppet-dashboard':
|
||||||
ensure => absent,
|
ensure => absent,
|
||||||
@ -35,10 +32,10 @@ class dashboard::passenger (
|
|||||||
}
|
}
|
||||||
|
|
||||||
apache::vhost { $dashboard_site:
|
apache::vhost { $dashboard_site:
|
||||||
port => '8080',
|
port => $dashboard_port,
|
||||||
priority => '50',
|
priority => '50',
|
||||||
docroot => '/usr/share/puppet-dashboard/public',
|
docroot => "${dashboard_root}/public",
|
||||||
template => 'dashboard/puppet-dashboard-passenger-vhost.erb',
|
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_password => 'changeme',
|
||||||
dashboard_db => 'dashboard_prod',
|
dashboard_db => 'dashboard_prod',
|
||||||
dashboard_charset => 'utf8',
|
dashboard_charset => 'utf8',
|
||||||
dashboard_site => $fqdn,
|
dashboard_site => $::fqdn,
|
||||||
dashboard_port => '8080',
|
dashboard_port => '8081',
|
||||||
mysql_root_pw => 'changemetoo',
|
mysql_root_pw => 'changemetoo',
|
||||||
passenger => true,
|
passenger => true,
|
||||||
mysql_package_provider => 'yum',
|
|
||||||
ruby_mysql_package => 'ruby-mysql',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user