Ansible/roles/luther38.logstash/tasks/ubuntu.yml

45 lines
801 B
YAML
Raw Permalink Normal View History

- name: Add Elastic repo
include: install-repo.yml
- name: Install logstash from apt
become: true
apt:
name: logstash
- name: Update config
become: true
template:
src: logstash.j2
dest: /tmp/logstash/logstash.yml
backup: yes
- name: UFW allow http_port
become: true
when: ufw_http_port == true
ufw:
rule: allow
port: "{{ http_port }}"
- name: UFW allow transport_port
become: true
when: ufw_transport_port == true
ufw:
rule: allow
port: "{{ transport_port }}"
- name: systemd enable elasticsearch
become: true
when: systemd_enabled == true
systemd:
name: elasticsearch
enabled: true
- name: systemd restart elasticsearch
become: true
when: systemd_restart == true
systemd:
name: elasticsearch
state: restarted