aurore-logs/roles/logstash/tasks/main.yml
Jeltz 665cc7bfb1 Remplacement de certains with_* par loop.
Sauf le `with_fileglob`, conformément aux recommendations de la
documentation Ansible :

    https://docs.ansible.com/ansible/latest/user_guide/playbooks_loops.html
2020-09-19 22:08:34 +02:00

48 lines
No EOL
869 B
YAML

---
- name: Install logstash
become: yes
apt:
name: logstash
state: present
- name: Create Grok patterns directory
become: yes
file:
path: /etc/logstash/patterns
state: directory
owner: root
group: root
mode: u=rwx,g=rx,o=rx
- name: Deploy Grok patterns
become: yes
copy:
src: "{{ item }}"
dest: /etc/logstash/patterns/
owner: logstash
group: logstash
mode: u=r,g=,o=
with_fileglob:
- patterns/*
- name: Deploy logstash configuration
become: yes
template:
src: "{{ item }}.j2"
dest: "/etc/logstash/conf.d/{{ item }}"
owner: logstash
group: logstash
mode: u=r,g=,o=
loop:
- main.conf
- sshd.conf
- pam_unix.conf
notify: Restart logstash
- name: Enable logstash service
become: yes
systemd:
name: logstash.service
state: started
enabled: yes
...