forked from evolix/ansible-roles
91 lines
2.1 KiB
YAML
91 lines
2.1 KiB
YAML
---
|
|
|
|
- name: APT https transport is enabled
|
|
apt:
|
|
name: apt-transport-https
|
|
state: present
|
|
tags:
|
|
- kibana
|
|
- packages
|
|
|
|
- name: Elastic GPG key is installed
|
|
apt_key:
|
|
# url: https://artifacts.elastic.co/GPG-KEY-elasticsearch
|
|
data: "{{ lookup('file', 'elasticsearch.key') }}"
|
|
state: present
|
|
tags:
|
|
- kibana
|
|
- packages
|
|
|
|
- name: Elastic sources list is available
|
|
apt_repository:
|
|
repo: "deb https://artifacts.elastic.co/packages/{{ elastic_stack_version | mandatory }}/apt stable main"
|
|
filename: elastic
|
|
state: present
|
|
update_cache: yes
|
|
tags:
|
|
- kibana
|
|
- packages
|
|
|
|
- name: Kibana is installed
|
|
apt:
|
|
name: kibana
|
|
state: present
|
|
tags:
|
|
- packages
|
|
|
|
- name: kibana server host configuration
|
|
lineinfile:
|
|
dest: /etc/kibana/kibana.yml
|
|
line: "server.host: \"{{ kibana_server_host }}\""
|
|
regexp: '^server.host:'
|
|
insertafter: '^#server.host:'
|
|
notify: restart kibana
|
|
|
|
- name: kibana server basepath configuration
|
|
lineinfile:
|
|
dest: /etc/kibana/kibana.yml
|
|
line: "server.basePath: \"{{ kibana_server_basepath }}\""
|
|
regexp: '^server.basePath:'
|
|
insertafter: '^#server.basePath:'
|
|
notify: restart kibana
|
|
|
|
- name: Kibana service is enabled and started
|
|
systemd:
|
|
name: kibana
|
|
enabled: yes
|
|
state: started
|
|
|
|
- name: Logrotate configuration is enabled
|
|
copy:
|
|
src: logrotate
|
|
dest: /etc/logrotate.d/kibana
|
|
mode: "0644"
|
|
owner: root
|
|
group: root
|
|
|
|
# - name: Get mount options for /usr partition
|
|
# shell: "mount | grep 'on /usr type'"
|
|
# args:
|
|
# warn: no
|
|
# register: mount
|
|
# changed_when: False
|
|
# failed_when: False
|
|
# when: not ansible_check_mode
|
|
#
|
|
# - block:
|
|
# - include_role:
|
|
# name: remount-usr
|
|
#
|
|
# - name: Move kibana optimize directory
|
|
# shell: "mv /usr/share/kibana/{{ item }} /var/lib/kibana/{{ item }} && ln -s /var/lib/kibana/{{ item }} /usr/share/kibana/{{ item }}"
|
|
# args:
|
|
# creates: "/var/lib/kibana/{{ item }}"
|
|
# notify: restart kibana
|
|
# with_items:
|
|
# - optimize
|
|
# - data
|
|
|
|
- include: proxy_nginx.yml
|
|
when: kibana_proxy_nginx
|