fedelemantuano / ansible-kibana

Ansible role for Kibana
https://galaxy.ansible.com/fedelemantuano/kibana
Apache License 2.0
17 stars 20 forks source link
ansible ansible-role elasticsearch elk kibana

Build Status

ansible-kibana

THIS ROLE IS FOR 7.x & 6.x

Ansible role for 7.x/6.x Kibana. Currently this works on Debian and RedHat based linux systems.

This role can install X-Pack version and you can pass from oss version to X-Pack and vice versa.

You can't install Kibana oss version with Elastic Stack version 7.x.

Usage

Create your Ansible playbook with your own tasks, and include the role ansible-kibana. You will have to have this repository accessible within the context of playbook, e.g.

e.g.

cd /my/repos/
git clone https://github.com/fedelemantuano/ansible-kibana.git
cd /my/ansible/playbook
mkdir -p roles
ln -s /my/repos/ansible-kibana ./roles/kibana

or

ansible-galaxy install fedelemantuano.kibana

Then create your playbook yaml adding the role kibana. The application of the kibana role results in the installation of a node on a host.

The simplest configuration therefore consists of:

- name: Simple Example
  hosts: localhost
  roles:
  - role: kibana
    kibana_config:
        server.name: "{{ inventory_hostname }}"
        server.port: 5601
        server.host: "{{ ansible_default_ipv4.address }}"
        elasticsearch.hosts: "http://{{ ansible_default_ipv4.address }}:9200"

The above installs the Kibana oss version on 'localhost'.

This role also uses Ansible tags. Run your playbook with the --list-tasks flag for more information.

Basic Kibana Configuration

All Kibana configuration parameters are supported. This is achieved using a configuration map parameter kibana_config which is serialized into the kibana.yml file. The use of a map ensures the Ansible playbook does not need to be updated to reflect new/deprecated/plugin configuration parameters.

These can be found in the role's defaults/main.yml file.

The following illustrates applying configuration parameters to an Kibana instance.

- name: Kibana with custom configuration
  hosts: localhost
  roles:
    #expand to all available parameters
    - role: kibana
      kibana_log_dir: "/var/log/kibana-node1"
      kibana_config:
        server.port: 5000,
        server.host: "192.168.0.11"

Important Note

The role uses kibana_api_host and kibana_api_port to communicate with the node for actions only achievable via http e.g. check the NODE IS ACTIVE. These default to localhost and 5601 respectively. If the node is deployed to bind on either a different host or port, these must be changed.

Installing X-Pack Features

This role can install X-Pack version. If you want to install it the kibana_install_oss must be false.

If you want install Elasticsearch and Kibana with basic subscription, you must use the following values for Elasticsearch role:

es_enable_xpack: true,
es_xpack_features: ["monitoring","graph"],

and

kibana_install_oss: false

for Kibana role.

Additional Configuration

In addition to kibana_config, the following parameters allow the customization of the Java and ELK versions as well as the role behaviour. Options include:

Both kibana_user_id and kibana_group_id must be set for the user and group ids to be set.

kibana_config:
    server.name: "{{ inventory_hostname }}"
    server.port: 5601
    server.host: "{{ ansible_default_ipv4.address }}"
    elasticsearch.hosts: "http://{{ ansible_default_ipv4.address }}:9200"
    elasticsearch.username: "kibana"
    elasticsearch.password: "changeme"

Proxy

To define proxy globaly, set the following variables:

Notes