Giter Site home page Giter Site logo

geerlingguy / ansible-role-kibana Goto Github PK

View Code? Open in Web Editor NEW
121.0 8.0 195.0 61 KB

Ansible Role - Kibana

Home Page: https://galaxy.ansible.com/geerlingguy/kibana/

License: MIT License

Jinja 100.00%
ansible role kibana elk logstash logging analytics data dashboard

ansible-role-kibana's Introduction

Ansible Role: Kibana

CI

An Ansible Role that installs Kibana on RedHat/CentOS or Debian/Ubuntu.

Requirements

None.

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

kibana_version: "7.x"

The version of kibana to install.

kibana_package: kibana
kibana_package_state: present

The specific package to be installed. You can specify a version of the package using the correct syntax for your platform and package manager by changing the package name. You can also control the package state (e.g. present, absent, or latest).

kibana_service_state: started
kibana_service_enabled: true

Controls whether the kibana service is started and enabled on system boot.

kibana_config_template: kibana.yml.j2
kibana_config_file_path: /etc/kibana/kibana.yml

The template to use for the Kibana config file, and the path to which the config file will be written.

kibana_server_port: 5601
kibana_server_host: "0.0.0.0"

The FQDN or IP address and port Kibana should use.

kibana_elasticsearch_url: "http://localhost:9200"

The URL (including port) over which Kibana will connect to Elasticsearch.

kibana_elasticsearch_username: ""
kibana_elasticsearch_password: ""

If Elasticsearch is protected by HTTP basic authentication, set the username and password so Kibana can connect.

Dependencies

None.

Example Playbook

- hosts: kibana
  roles:
    - geerlingguy.kibana

License

MIT / BSD

Author Information

This role was created in 2014 by Jeff Geerling, author of Ansible for DevOps.

ansible-role-kibana's People

Contributors

atomlab avatar geerlingguy avatar miettal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-role-kibana's Issues

No package matching 'gnupg2' is available

When deploying on Ubuntu 20.04.2 LTS the following error appears:
TASK [geerlingguy.kibana : Ensure dependencies are installed.] ****************************************************************************************************** fatal: [dc2-elastic1]: FAILED! => {"changed": false, "msg": "No package matching 'gnupg2' is available"} fatal: [dc2-elastic2]: FAILED! => {"changed": false, "msg": "No package matching 'gnupg2' is available"}

At OS level:
`root@dc2-elastic1:~# apt-get install gnupg2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package gnupg2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
gpgv gpgsm gnupg-l10n gnupg dirmngr

E: Package 'gnupg2' has no installation candidate
`

root@dc2-elastic1:~# apt-get install gnupg Reading package lists... Done Building dependency tree Reading state information... Done gnupg is already the newest version (2.2.19-3ubuntu2.1). The following package was automatically installed and is no longer required: libnuma1 Use 'apt autoremove' to remove it. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Fresh install of 7.9.1 fails

After installing 7.9.1 Kibana fails to start and I can see

Babel could not write cache to file: /usr/share/kibana/optimize/.babel_register_cache.json
due to a permission issue. Cache is disabled.
  log   [07:59:29.507] [warning][plugins-discovery] Expect plugin "id" in camelCase, but found: beats_management
  log   [07:59:29.514] [warning][plugins-discovery] Expect plugin "id" in camelCase, but found: triggers_actions_ui

in the logs

Running chown -R kibana:kibana /usr/share/kibana/optimize/ fixes this.

Missing `become`?

Using the steps outlined in the README.md:

- hosts: kibana
  roles:
    - geerlingguy.kibana

I'm greeted with this:

TASK [geerlingguy.kibana : Install Kibana.] *********************************************************
Sunday 21 August 2022  15:57:33 -0400 (0:00:01.106)       0:00:07.979 ********* 
fatal: [redacted]: FAILED! => changed=false 
  cache_update_time: 1661095691
  cache_updated: false
  msg: |-
    '/usr/bin/apt-get -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold"       install 'kibana=7.17.5'' failed: E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
    E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
  rc: 100
  stderr: |-
    E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
    E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
  stderr_lines: <omitted>
  stdout: ''
  stdout_lines: <omitted>

Presumably the entire role is meant to be run with become: true?

No logrotate set

No logrotate configuration are been pushed during installation step which caused some trouble in FS side if nothing is done on the kibana log directory

Enable multiple elasticsearch_hosts

As in geerlingguy/ansible-role-logstash logstash_elasticsearch_hosts , enable kibana_elasticsearch_hosts, allowing to pass multiple elasticsearch hosts instead of only one.

Systemd daemon reload needed in Ubuntu

Running the role in a Ubuntu focal VM the first run fails because the service kibana doesn't exist after installing successfully the package.
Checking the service status with systemd, it answer that it doesn't exist.
After manually reloading systemd daemon, the service is there.
This could be solve using the systemd module instead of service, but I'm guessing you choose service because it handle other kind of systems (initd?).
So i could do a PR changing to systemd, or I could do one using systemd when a condition is true (I have to think the best way for this).
Any opinions?

Kibana install from elastic artifacts fails

Platform: CentOS 7.5.

In its original state, installing Kibana (version 6.5.4) fails with the following error message:

fatal: [12.34.56.78]: FAILED! => {"changed": false, "msg": "Failure talking to yum: failure: repodata/repomd.xml from kibana-6.5.4: [Errno 256] No more mirrors to try.\nhttps://artifacts.elastic.co/packages/6.5.4/yum/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found"}

I am able to get around this problem, by executing the following the tasks before ansible-role-kibana:

  • name: Add Elasticsearch GPG key.
    rpm_key:
    key: https://artifacts.elastic.co/GPG-KEY-elasticsearch
    state: present

  • name: Set fact kibana_version for kibana.repo.j2 template copy
    set_fact:
    kibana_version: "{{ kibana.kibana_version }}"

  • name: Add Kibana repository.
    template:
    src: kibana.repo.j2
    dest: /etc/yum.repos.d/kibana.repo
    mode: 0644

  • name: Set kibana-repository to be skipped if unavailable.
    shell: yum-config-manager --save --setopt={{ kibana.kibana_package }}-{{ kibana.kibana_version }}.skip_if_unavailable=true

  • name: Install Kibana
    yum: name={{ kibana.kibana_package }}-{{ kibana.kibana_version }} state=present

The Kibana package has to be installed using "yum", using "package", as is used inside the ansible-role-kibana, will fail with the above error message. But now that the package is already installed, including role ansible-role-kibana will work.

But, after executing the role, it is crucial to set kibana-repository "skipped if unavailable" again, otherwise the next package being installed from yum, will fail with the same error message ("Failure talking to yum ..."). Although at this point, it is nearly the same to not use the role at all.

Any idea how the role could be fixed at the source, without needing these hacks?

fails to run in ELK playbook because of dependency to NGINX, a required group is missing

quick fix: groupadd nginx ## re-run playbook again
suggested fix: add missing group creation to playbook

output (ubuntu 14.04.1LTS on vsphere 5.5):
TASK: [geerlingguy.kibana | Create Kibana user account.] **********************
failed: [10.0.x.xxx] => {"failed": true, "gid": 0, "group": "root", "mode": "0644", "owner": "root", "path": "/etc/nginx/conf.d/kibana.htpasswd", "size": 45, "state": "file", "uid": 0}
msg: chgrp failed: failed to look up group nginx

FATAL: all hosts have already failed -- aborting

Incorrect config dir on CENTOS 7

Hey, thanks for writing this! One issue:

In roles/kibana/tasks/main.yml

The destination for kibana.yml should be:
/etc/kibana/kibana.yml and not /opt/kibana/config/kibana.yml"

New release up to date

Hi,

Please can you create a new tag including the last commit done on master ?

Thank you

Add support for end-2-end encryption

We're not able to configure end-2-end encryption (frontend and Elasticsearch backend) with this role.

server.ssl.enabled: true server.ssl.certificate: /etc/kibana/certs/elk.crt server.ssl.key: /etc/kibana/certs/elk.key

elasticsearch.ssl.certificate: /etc/kibana/certs/elk.crt elasticsearch.ssl.key: /etc/kibana/certs/elk.key elasticsearch.ssl.certificateAuthorities: [ "/etc/kibana/certs/root.crt" ]

This option should be added, included with an optional upload of certificate files, like in the Elasticsearch role.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.