Kibana: extract kibana-proxy-nginx

This commit is contained in:
Jérémy Lecour 2016-11-22 15:29:19 +01:00 committed by Jérémy Lecour
parent b82587b2b7
commit 89d5c4f3a1
5 changed files with 32 additions and 16 deletions

View file

@ -0,0 +1,14 @@
# kibana
Install Kibana.
## Tasks
Everything is in the `tasks/main.yml` file.
## Available variables
The only variables are derived from gathered facts.
By default, Kibana will bind to localhost:5601.
If Nginx is installed, a typical proxy configuration is copied into `/etc/nginx/sites-available`. It can be tweeked and enabled by hand.

View file

@ -0,0 +1,2 @@
kibana_proxy_bind: "{{ ansible_default_ipv4.address }}:80"
kibana_proxy_domain: "kibana.{{ ansible_fqdn }}"

View file

@ -0,0 +1,14 @@
---
- name: Example proxy for Kibana with Nginx
template:
src: nginx_proxy_kibana.j2
dest: /etc/nginx/sites-available/kibana.conf
force: no
- name: Kibana host in Nginx is enabled
file:
src: /etc/nginx/sites-available/kibana.conf
dest: /etc/nginx/sites-enabled/kibana.conf
state: link
notify: reload nginx

View file

@ -6,10 +6,8 @@ server {
# ajouter les règles d'authentification
{% for address in ansible_all_ipv4_addresses %}
listen {{ address }}:80;
{% endfor %}
server_name {{ ansible_hostname }};
listen {{ kibana_proxy_bind }};
server_name {{ kibana_proxy_domain }};
location / {
proxy_redirect off;

View file

@ -21,15 +21,3 @@
mode: 0644
owner: root
group: root
- name: Nginx installed?
stat:
path: /etc/nginx/sites-available/
register: nginx_installed
- name: Example proxy for Kibana with Nginx
template:
src: nginx_proxy_kibana.j2
dest: /etc/nginx/sites-available/kibana.conf
force: no
when: nginx_installed.stat.exists