Puppet module to add kibana functionality
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

js.pp 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # Copyright 2015 Hewlett-Packard Development Company, L.P.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License"); you may
  4. # not use this file except in compliance with the License. You may obtain
  5. # a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  11. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  12. # License for the specific language governing permissions and limitations
  13. # under the License.
  14. #
  15. # Class to install kibana frontend to logstash.
  16. #
  17. class kibana::js (
  18. $vhost_template = 'kibana/dual-elasticsearch.vhost.erb',
  19. $vhost_aliases = [],
  20. $vhost_name = $::fqdn,
  21. $vhost_proxy_timeout = '120',
  22. $vhost_proxy_connect_timeout = '15',
  23. $elasticsearch_url = 'http://localhost:9200',
  24. $elasticsearch_prefix = '/', # Must contain trailing /
  25. $git_revision = 'v3.1.2',
  26. ) {
  27. $base_path = "/opt/kibana/${git_revision}"
  28. vcsrepo { $base_path:
  29. ensure => latest,
  30. provider => 'git',
  31. source => 'https://github.com/elasticsearch/kibana.git',
  32. revision => $git_revision,
  33. owner => 'www-data',
  34. }
  35. file { "${base_path}/src/config.js":
  36. ensure => present,
  37. content => template('kibana/config.js.erb'),
  38. owner => 'www-data',
  39. require => Vcsrepo[$base_path],
  40. subscribe => Vcsrepo[$base_path],
  41. }
  42. apache::vhost { 'kibana':
  43. docroot => "${base_path}/src",
  44. vhost_name => $vhost_name,
  45. serveraliases => $vhost_aliases,
  46. port => 80,
  47. template => $vhost_template,
  48. }
  49. }