54 lines
1.6 KiB
YAML
54 lines
1.6 KiB
YAML
---
|
|
- import_tasks: RedHat.yml
|
|
when: ansible_os_family == 'RedHat'
|
|
|
|
- import_tasks: Debian.yml
|
|
when: ansible_os_family == "Debian"
|
|
|
|
- import_tasks: config.yml
|
|
when: logstash_create_config
|
|
|
|
- name: Reload systemd
|
|
systemd: daemon_reload=yes
|
|
ignore_errors: true
|
|
when:
|
|
- not (ansible_distribution == "Amazon" and ansible_distribution_major_version == "NA")
|
|
- not (ansible_distribution == "Ubuntu" and ansible_distribution_version is version('15.04', '<'))
|
|
- not (ansible_distribution == "Debian" and ansible_distribution_version is version('8', '<'))
|
|
- not (ansible_os_family == "RedHat" and ansible_distribution_version is version('7', '<'))
|
|
|
|
- name: Amazon Linux create service
|
|
shell: /usr/share/logstash/bin/system-install /etc/logstash/startup.options
|
|
when: ansible_distribution == "Amazon" and ansible_distribution_major_version == "NA"
|
|
args:
|
|
creates: /etc/default/logstash
|
|
tags:
|
|
- skip_ansible_lint
|
|
|
|
- name: Amazon Linux create service
|
|
shell: /usr/share/logstash/bin/system-install /etc/logstash/startup.options
|
|
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "6"
|
|
args:
|
|
creates: /etc/default/logstash
|
|
tags:
|
|
- skip_ansible_lint
|
|
|
|
- name: Ensure Logstash started and enabled
|
|
service:
|
|
name: logstash
|
|
enabled: true
|
|
state: started
|
|
|
|
- name: Amazon Linux start Logstash
|
|
service:
|
|
name: logstash
|
|
enabled: true
|
|
state: started
|
|
when: ansible_distribution == "Amazon" and ansible_distribution_major_version == "NA"
|
|
|
|
- import_tasks: "RMRedHat.yml"
|
|
when: ansible_os_family == "RedHat"
|
|
|
|
- import_tasks: "RMDebian.yml"
|
|
when: ansible_os_family == "Debian"
|