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.

init.pp 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # Copyright 2013 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 (
  18. $discover_nodes = ['localhost:9200'],
  19. $version = 'ruby',
  20. $js_vhost_name = $::fqdn,
  21. $js_vhost_aliases = [],
  22. $js_vhost_template = 'kibana/dual-elasticsearch.vhost.erb',
  23. $js_elasticsearch_prefix = '/',
  24. $js_elasticsearch_url = 'http://localhost:9200',
  25. ) {
  26. group { 'kibana':
  27. ensure => present,
  28. }
  29. user { 'kibana':
  30. ensure => present,
  31. comment => 'Kibana User',
  32. home => '/opt/kibana',
  33. gid => 'kibana',
  34. shell => '/bin/bash',
  35. membership => 'minimum',
  36. require => Group['kibana'],
  37. }
  38. file { '/opt/kibana':
  39. ensure => directory,
  40. owner => 'kibana',
  41. group => 'kibana',
  42. mode => '0644',
  43. recurse => true,
  44. require => User['kibana'],
  45. }
  46. case $version {
  47. 'ruby': {
  48. include ::kibana::ruby
  49. }
  50. 'js': {
  51. class { '::kibana::js':
  52. vhost_name => $js_vhost_name,
  53. vhost_aliases => $js_vhost_aliases,
  54. vhost_template => $js_vhost_template,
  55. elasticsearch_prefix => $js_elasticsearch_prefix,
  56. elasticsearch_url => $js_elasticsearch_url,
  57. }
  58. }
  59. default: {
  60. fail("Unknown version: ${version}")
  61. }
  62. }
  63. }