Logstash role: split config tasks from main tasks
This commit is contained in:
parent
1598ceedcd
commit
d59e8cd0be
35
ansible-role-logstash/tasks/config.yml
Normal file
35
ansible-role-logstash/tasks/config.yml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
---
|
||||||
|
- name: Logstash template
|
||||||
|
template:
|
||||||
|
src: wazuh-elastic5-template.json.j2
|
||||||
|
dest: /etc/logstash/wazuh-elastic5-template.json
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
tags: configure
|
||||||
|
|
||||||
|
- name: Ensure Logstash SSL key pair directory exists.
|
||||||
|
file:
|
||||||
|
path: "{{ logstash_ssl_dir }}"
|
||||||
|
state: directory
|
||||||
|
when: logstash_ssl
|
||||||
|
tags: configure
|
||||||
|
|
||||||
|
- name: Copy SSL key and cert for logstash.
|
||||||
|
copy:
|
||||||
|
src: "{{ item }}"
|
||||||
|
dest: "{{ logstash_ssl_dir }}/{{ item | basename }}"
|
||||||
|
mode: 0644
|
||||||
|
with_items:
|
||||||
|
- "{{ logstash_ssl_key_file }}"
|
||||||
|
- "{{ logstash_ssl_certificate_file }}"
|
||||||
|
when: logstash_ssl
|
||||||
|
tags: configure
|
||||||
|
|
||||||
|
- name: Logstash configuration
|
||||||
|
template:
|
||||||
|
src: 01-wazuh.conf.j2
|
||||||
|
dest: /etc/logstash/conf.d/01-wazuh.conf
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
notify: restart logstash
|
||||||
|
tags: configure
|
||||||
@ -5,23 +5,8 @@
|
|||||||
- include: Debian.yml
|
- include: Debian.yml
|
||||||
when: ansible_os_family == "Debian"
|
when: ansible_os_family == "Debian"
|
||||||
|
|
||||||
- name: Logstash configuration
|
- include: config.yml
|
||||||
template:
|
when: logstash_create_config
|
||||||
src: 01-wazuh.conf.j2
|
|
||||||
dest: /etc/logstash/conf.d/01-wazuh.conf
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
notify: restart logstash
|
|
||||||
tags: configure
|
|
||||||
|
|
||||||
- name: Logstash template
|
|
||||||
template:
|
|
||||||
src: wazuh-elastic5-template.json.j2
|
|
||||||
dest: /etc/logstash/wazuh-elastic5-template.json
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
notify: restart logstash
|
|
||||||
tags: configure
|
|
||||||
|
|
||||||
- name: Ensure Logstash started and enabled
|
- name: Ensure Logstash started and enabled
|
||||||
service:
|
service:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user