2013-01-16 15:01:25 -08:00
|
|
|
# Copyright 2013 Hewlett-Packard Development Company, L.P.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
|
|
# not use this file except in compliance with the License. You may obtain
|
|
|
|
# a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
# License for the specific language governing permissions and limitations
|
|
|
|
# under the License.
|
|
|
|
#
|
|
|
|
# Logstash indexer server glue class.
|
|
|
|
#
|
|
|
|
class openstack_project::logstash (
|
|
|
|
$sysadmins = []
|
|
|
|
) {
|
|
|
|
class { 'openstack_project::server':
|
|
|
|
iptables_public_tcp_ports => [22, 80],
|
|
|
|
sysadmins => $sysadmins,
|
|
|
|
}
|
|
|
|
|
|
|
|
class { 'logstash::indexer':
|
|
|
|
conf_template => 'openstack_project/logstash/indexer.conf.erb',
|
|
|
|
}
|
2013-04-17 22:15:20 +00:00
|
|
|
class { 'logstash::web':
|
|
|
|
frontend => 'kibana',
|
|
|
|
}
|
2013-04-24 15:20:14 -07:00
|
|
|
|
2013-04-03 13:03:23 -07:00
|
|
|
package { 'python3':
|
|
|
|
ensure => 'present',
|
|
|
|
}
|
|
|
|
|
2013-04-08 14:59:32 -07:00
|
|
|
package { 'python3-zmq':
|
|
|
|
ensure => 'present',
|
|
|
|
}
|
|
|
|
|
2013-05-02 14:54:13 -07:00
|
|
|
package { 'python3-yaml':
|
|
|
|
ensure => 'present',
|
|
|
|
}
|
|
|
|
|
2013-04-03 13:03:23 -07:00
|
|
|
file { '/usr/local/bin/log-pusher.py':
|
|
|
|
ensure => present,
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0755',
|
2013-04-08 13:45:30 -07:00
|
|
|
source => 'puppet:///modules/openstack_project/logstash/log-pusher.py',
|
2013-04-03 13:03:23 -07:00
|
|
|
require => Package['python3'],
|
|
|
|
}
|
2013-04-10 10:18:35 -07:00
|
|
|
|
2013-05-02 14:54:13 -07:00
|
|
|
file { '/etc/logstash/jenkins-log-pusher.yaml':
|
|
|
|
ensure => present,
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0555',
|
|
|
|
source => 'puppet:///modules/openstack_project/logstash/jenkins-log-pusher.yaml',
|
|
|
|
require => Class['logstash::indexer'],
|
|
|
|
}
|
|
|
|
|
2013-05-02 12:02:08 -07:00
|
|
|
file { '/etc/init.d/jenkins-log-pusher':
|
|
|
|
ensure => present,
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0555',
|
|
|
|
source => 'puppet:///modules/openstack_project/logstash/jenkins-log-pusher.init',
|
2013-05-02 14:54:13 -07:00
|
|
|
require => [
|
|
|
|
File['/usr/local/bin/log-pusher.py'],
|
|
|
|
File['/etc/logstash/jenkins-log-pusher.yaml'],
|
|
|
|
],
|
2013-05-02 12:02:08 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
service { 'jenkins-log-pusher':
|
|
|
|
enable => true,
|
|
|
|
hasrestart => true,
|
2013-05-21 14:51:33 -07:00
|
|
|
subscribe => File['/etc/logstash/jenkins-log-pusher.yaml'],
|
2013-05-02 12:02:08 -07:00
|
|
|
require => File['/etc/init.d/jenkins-log-pusher'],
|
|
|
|
}
|
2013-01-16 15:01:25 -08:00
|
|
|
}
|