Kibana: extract kibana-proxy-nginx
This commit is contained in:
parent
b82587b2b7
commit
89d5c4f3a1
5 changed files with 32 additions and 16 deletions
14
kibana-proxy-nginx/README.md
Normal file
14
kibana-proxy-nginx/README.md
Normal 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.
|
2
kibana-proxy-nginx/defaults/main.yml
Normal file
2
kibana-proxy-nginx/defaults/main.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
kibana_proxy_bind: "{{ ansible_default_ipv4.address }}:80"
|
||||
kibana_proxy_domain: "kibana.{{ ansible_fqdn }}"
|
14
kibana-proxy-nginx/tasks/main.yml
Normal file
14
kibana-proxy-nginx/tasks/main.yml
Normal 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
|
|
@ -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;
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue