Skip to content

Commit

Permalink
Merge pull request #41 from RSE-Cambridge/fluentd-fix
Browse files Browse the repository at this point in the history
Fix fluentd configuration tasks
  • Loading branch information
brtkwr authored Mar 16, 2021
2 parents b8e531f + 994c02a commit 837f2a8
Showing 1 changed file with 10 additions and 63 deletions.
73 changes: 10 additions & 63 deletions ansible/roles/common/tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,69 +70,6 @@
register: find_custom_fluentd_inputs
when: common_services.fluentd.enabled | bool

- name: Copying over fluentd input config files
vars:
customised_input_files: "{{ find_custom_fluentd_inputs.files | map(attribute='path') | map('basename') | list }}"
template:
src: "conf/input/{{ item }}.conf.j2"
dest: "{{ node_config_directory }}/fluentd/input/{{ item }}.conf"
mode: "0660"
become: true
when:
- enable_fluentd | bool
- item ~ '.conf' not in customised_input_files
with_items:
- "00-global"
- "01-syslog"
- "02-mariadb"
- "03-rabbitmq"
- "04-openstack-wsgi"
- "05-libvirt"
- "06-zookeeper"
- "07-kafka"
- "08-opendaylight"
- "09-monasca"
- "10-caso"
notify:
- Restart fluentd container

- name: Copying over cASO input config file
template:
src: "conf/input/10-caso.conf.j2"
dest: "{{ node_config_directory }}/fluentd/input/10-caso.conf"
mode: "0660"
become: true
notify:
- Restart fluentd container
when: enable_fluentd | bool and enable_caso | bool and inventory_hostname in groups['caso']

- name: Copying over cASO input config file
template:
src: "conf/input/10-caso.conf.j2"
dest: "{{ node_config_directory }}/fluentd/input/10-caso.conf"
mode: "0660"
become: true
notify:
- Restart fluentd container
when: enable_fluentd | bool and enable_caso | bool and inventory_hostname in groups['caso']

- name: Copying over custom fluentd input config files
template:
src: "{{ item.path }}"
dest: "{{ node_config_directory }}/fluentd/input/{{ item.path | basename }}"
mode: "0660"
when:
- enable_fluentd | bool
with_items: "{{ find_custom_fluentd_inputs.files }}"
notify:
- Restart fluentd container

- name: Determine whether logs should be forwarded directly to Elasticsearch
set_fact:
log_direct_to_elasticsearch: "{{ ( enable_elasticsearch | bool or
( elasticsearch_address != kolla_internal_vip_address )) and
not enable_monasca | bool }}"

- name: Find custom fluentd filter config files
local_action:
module: find
Expand All @@ -142,6 +79,15 @@
register: find_custom_fluentd_filters
when: common_services.fluentd.enabled | bool

- name: Find custom fluentd format config files
local_action:
module: find
path: "{{ node_custom_config }}/fluentd/format"
pattern: "*.conf"
run_once: True
register: find_custom_fluentd_formats
when: common_services.fluentd.enabled | bool

- name: Find custom fluentd output config files
local_action:
module: find
Expand Down Expand Up @@ -170,6 +116,7 @@
- "conf/input/06-zookeeper.conf.j2"
- "conf/input/07-kafka.conf.j2"
- "conf/input/09-monasca.conf.j2"
- "conf/input/10-caso.conf.j2"
customised_input_files: "{{ find_custom_fluentd_inputs.files | map(attribute='path') | list }}"
# Filters
fluentd_filter_files: "{{ default_filter_files | customise_fluentd(customised_filter_files) }}"
Expand Down

0 comments on commit 837f2a8

Please sign in to comment.