Merge "Nodepool image logs accessible via HTTP"

This commit is contained in:
Jenkins 2014-02-20 19:34:57 +00:00 committed by Gerrit Code Review
commit a078da3b2f
3 changed files with 39 additions and 7 deletions

View File

@ -23,7 +23,10 @@ class nodepool (
$nodepool_ssh_private_key = '',
$git_source_repo = 'https://git.openstack.org/openstack-infra/nodepool',
$revision = 'master',
$statsd_host = ''
$statsd_host = '',
$vhost_name = 'nodepool.openstack.org',
$image_log_document_root = '/var/log/nodepool/image',
$enable_image_log_via_http = false,
) {
class { 'mysql::server':
@ -144,7 +147,7 @@ class nodepool (
mode => '0444',
owner => 'root',
group => 'root',
source => 'puppet:///modules/nodepool/logging.conf',
content => template('nodepool/nodepool.logging.conf.erb'),
notify => Service['nodepool'],
}
@ -162,4 +165,28 @@ class nodepool (
hasrestart => true,
require => File['/etc/init.d/nodepool'],
}
if $enable_image_log_via_http == true {
# Setup apache for image log access
include apache
apache::vhost { $vhost_name:
port => 80,
priority => '50',
docroot => $image_log_document_root,
}
if $image_log_document_root != '/var/log/nodepool' {
file { $image_log_document_root:
ensure => directory,
mode => '0755',
owner => 'nodepool',
group => 'nodepool',
require => [
User['nodepool'],
File['/var/log/nodepool'],
],
}
}
}
}

View File

@ -49,7 +49,7 @@ args=('/var/log/nodepool/nodepool.log', 'midnight', 1, 30,)
level=INFO
class=logging.handlers.TimedRotatingFileHandler
formatter=simple
args=('/var/log/nodepool/image.log', 'midnight', 1, 30,)
args=('<%= @image_log_document_root %>/image.log', 'midnight', 1, 30,)
[formatter_simple]
format=%(asctime)s %(levelname)s %(name)s: %(message)s

View File

@ -19,16 +19,21 @@ class openstack_project::nodepool(
$tripleo_username ='',
$tripleo_password ='',
$tripleo_project ='',
$image_log_document_root = '/var/log/nodepool/image',
$enable_image_log_via_http = true,
) {
class { 'openstack_project::server':
sysadmins => $sysadmins,
iptables_public_tcp_ports => [80],
}
class { '::nodepool':
mysql_root_password => $mysql_root_password,
mysql_password => $mysql_password,
nodepool_ssh_private_key => $nodepool_ssh_private_key,
statsd_host => $statsd_host,
mysql_root_password => $mysql_root_password,
mysql_password => $mysql_password,
nodepool_ssh_private_key => $nodepool_ssh_private_key,
statsd_host => $statsd_host,
image_log_document_root => $image_log_document_root,
enable_image_log_via_http => $enable_image_log_via_http,
}
file { '/etc/nodepool/nodepool.yaml':