-
Notifications
You must be signed in to change notification settings - Fork 7
/
elk.yml
75 lines (63 loc) · 1.79 KB
/
elk.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# vim: ft=ansible
---
- hosts: elasticsearch
become: true
tags:
- elasticsearch
- elk
vars_files:
- "{{ inventory_dir }}/{{ vars_files_relative }}/vars/main.yml"
- ~/.ansible/vars/toad_vars.yml
roles:
- { role: 'geerlingguy.repo-epel' }
- { role: 'leifmadsen.elasticsearch' }
- hosts: logstash
become: true
tags:
- logstash
- elk
vars_files:
- "{{ inventory_dir }}/{{ vars_files_relative }}/vars/main.yml"
- ~/.ansible/vars/toad_vars.yml
roles:
- { role: 'geerlingguy.repo-epel' }
- { role: 'geerlingguy.java' }
- { role: 'leifmadsen.logstash' }
post_tasks:
- name: Add JAVA_HOME in /etc/default/logstash
lineinfile:
dest=/etc/default/logstash
line='export JAVA_HOME=/usr/lib/jvm/jre'
create=yes
when: deploy_type is defined and deploy_type == 'docker'
notify: restart logstash
- hosts: kibana
become: true
tags:
- kibana
- elk
vars_files:
- "{{ inventory_dir }}/{{ vars_files_relative }}/vars/main.yml"
- ~/.ansible/vars/toad_vars.yml
roles:
- { role: 'geerlingguy.repo-epel' }
- { role: 'geerlingguy.nginx' }
- { role: 'leifmadsen.kibana-4' }
post_tasks:
- name: Ensure libsemanage-python is installed
package:
name: libsemanage-python
state: present
- name: Validate SELinux is enabled
selinux:
policy: targeted
state: enforcing
when: ansible_connection != 'docker'
#when: deploy_type is not defined or deploy_type != 'docker'
- name: SELinux -- Enable httpd_can_network_connect
seboolean:
name: httpd_can_network_connect
state: yes
persistent: yes
when: ansible_connection != 'docker'
#when: deploy_type is not defined or deploy_type != 'docker'