mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-07-29 10:25:30 +02:00
Update to 2021-12-01 19:13
This commit is contained in:
33
roles/graylog/tasks/conf.yml
Normal file
33
roles/graylog/tasks/conf.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
|
||||
- name: Deploy configuration
|
||||
template: src={{ item }}.j2 dest={{ graylog_root_dir }}/etc/{{ item }} group=graylog mode=640
|
||||
loop:
|
||||
- server.conf
|
||||
- log4j2.xml
|
||||
notify: restart graylog-server
|
||||
tags: graylog
|
||||
|
||||
- name: Create the mongodb user
|
||||
mongodb_user:
|
||||
database: "{{ item | urlsplit('path') | regex_replace('^\\/', '') }}"
|
||||
name: "{{ graylog_mongo_user }}"
|
||||
password: "{{ graylog_mongo_pass }}"
|
||||
login_database: admin
|
||||
login_host: "{{ item | urlsplit('hostname') }}"
|
||||
login_port: "{{ item | urlsplit('port') | ternary(item | urlsplit('port'),omit) }}"
|
||||
login_user: mongoadmin
|
||||
login_password: "{{ mongo_admin_pass }}"
|
||||
roles:
|
||||
- readWrite
|
||||
loop: "{{ graylog_mongo_url }}"
|
||||
changed_when: False # the module is buggy and indicates a change even if there were none
|
||||
when:
|
||||
- graylog_mongo_url | length == 1
|
||||
- graylog_mongo_pass is defined
|
||||
- graylog_mongo_pass != False
|
||||
tags: graylog
|
||||
|
||||
- name: Deploy logrotate configuration
|
||||
template: src=logrotate.conf.j2 dest=/etc/logrotate.d/graylog
|
||||
tags: graylog
|
Reference in New Issue
Block a user