ansible-roles/kibana/tasks/main.yml

91 lines
2.1 KiB
YAML
Raw Normal View History

2016-11-17 15:16:19 +01:00
---
2017-07-13 14:43:07 +02:00
- 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:
2017-11-26 12:32:12 +01:00
repo: "deb https://artifacts.elastic.co/packages/{{ elastic_stack_version | mandatory }}/apt stable main"
2017-11-14 10:26:48 +01:00
filename: elastic
2017-07-13 14:43:07 +02:00
state: present
update_cache: yes
tags:
- kibana
- packages
2016-11-17 15:16:19 +01:00
- name: Kibana is installed
apt:
name: kibana
state: present
2016-11-17 15:16:19 +01:00
tags:
- packages
- name: kibana server host configuration
lineinfile:
2017-11-17 11:30:30 +01:00
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:
2017-11-17 11:30:30 +01:00
dest: /etc/kibana/kibana.yml
line: "server.basePath: \"{{ kibana_server_basepath }}\""
regexp: '^server.basePath:'
insertafter: '^#server.basePath:'
notify: restart kibana
2016-11-17 15:16:19 +01:00
- name: Kibana service is enabled and started
2017-10-08 22:31:22 +02:00
systemd:
2016-11-17 15:16:19 +01:00
name: kibana
enabled: yes
state: started
- name: Logrotate configuration is enabled
copy:
src: logrotate
dest: /etc/logrotate.d/kibana
mode: "0644"
2016-11-17 15:16:19 +01:00
owner: root
group: root
2017-11-26 12:32:12 +01:00
# - 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
2018-04-04 23:21:31 +02:00
#
2017-11-26 12:32:12 +01:00
# - 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