-
Notifications
You must be signed in to change notification settings - Fork 1
/
install_and_configure_kibana.yml
59 lines (49 loc) · 1.66 KB
/
install_and_configure_kibana.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
- hosts: all
tasks:
- name: Install the latest version of kibana
yum:
name: kibana
state: latest
- name: Starting and enabling Kibana...
shell: |
systemctl enable kibana
systemctl start kibana
- name: Refreshing file /etc/nginx/htpasswd.users
file:
path: /etc/nginx/htpasswd.users
state: absent
- name: Creating a user for Kibana...
shell: |
echo "kibanaadmin:`openssl passwd -apr1 kibanaadmin`" | sudo tee -a /etc/nginx/htpasswd.users
- name: Refreshing file /etc/nginx/conf.d/kibana.conf
file:
path: /etc/nginx/conf.d/kibana.conf
state: absent
- name: Creating the Nginx conf file for Kibana...
shell: |
echo > /etc/nginx/conf.d/kibana.conf
- name: Add info for Kibana conf file...
blockinfile: |
dest=/etc/nginx/conf.d/kibana.conf
content="server {
listen 81;
auth_basic_user_file /etc/nginx/htpasswd.users;
location / {
proxy_pass http://localhost:5601;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}"
- name: And mising parameter for Nginx conf file...
lineinfile:
path: /etc/nginx/conf.d/kibana.conf
insertafter: "^#?listen"
line: 'auth_basic "Restricted Access";'
- name: Restart Nginx and configure SElinux policy to allow Nginx to access the proxied service...
shell: |
systemctl restart nginx
setsebool httpd_can_network_connect 1 -P