main.yml
1.53 KB
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
---
# tasks file for roles/elk-prerequisitos
- name: Add the fs.file-max on the sysctl.conf
sysctl:
name: fs.file-max
value: '{{ fsfile_max_value }}'
reload: yes
tags:
- add_the_fsfilemax_on_the_sysctlconf
- elk_prerequisitos
- name: Add the max map count on sysctl.conf
sysctl:
name: vm.max_map_count
value: '{{ vm_max_map_count_value }}'
reload: yes
tags:
- add_the_max_map_count_on_sysctlconf
- elk_prerequisitos
- name: Configure the fs.file max per user
pam_limits:
domain: "{{ fsfile_max_user }}"
limit_type: "{{ item.lim_type }}"
limit_item: "{{ item.lim_item }}"
value: "{{ item.value }}"
loop:
- {lim_type: 'soft', lim_item: 'nproc', value: '{{ fsfile_max_value }}'}
- {lim_type: 'soft', lim_item: 'nofile', value: '{{ fsfile_max_value }}'}
- {lim_type: 'hard', lim_item: 'nproc', value: '{{ fsfile_max_value }}'}
- {lim_type: 'hard', lim_item: 'nofile', value: '{{ fsfile_max_value }}'}
tags:
- configure_the_fsfilemax_per_user
- elk_prerequisitos
- name: Start firewall
service:
name: firewalld
state: started
tags:
- start_firewall
- elk_prerequisitos
- name: Configure firewall ports
firewalld:
port: "{{ item.port }}"
permanent: yes
state: "{{ item.state }}"
immediate: yes
loop:
- {port: '9200/tcp', state: 'enabled'}
- {port: '9300/tcp', state: 'enabled'}
- {port: '5601/tcp', state: 'enabled'}
when: ansible_os_family == "RedHat"
tags:
- configure_firewll_ports
- elk_prerequisitos