From 419a2fc9fd206447f37fbcf62da8e15ab96f8530 Mon Sep 17 00:00:00 2001 From: chenxing Date: Wed, 8 Nov 2017 08:39:35 +0000 Subject: [PATCH] Fix the deprecated syntax in 01-rewrite.conf The current syntax of Ubuntu fluentd rewrite rules are not supported anymore, reference to this commit[1]. According to the build of this patch[2], The Centos has no such isuue. Only Ubuntu needs to be upgrade to use the section. * Centos use 01-rewrite-0.12.conf.j2 * Ubuntu use 01-rewrite-0.14.conf.j2 backport: pike [1] https://github.com/fluent/fluent-plugin-rewrite-tag-filter/commit/248ed8e97def0a60121199c0d0e2fa8785f0d076 [2] https://review.openstack.org/#/c/517907 Depends-on: I47985113fe732569d640a262ca832c6edc8c2bb6 Change-Id: I0b131c2f65652cf3c61b33d8162097b047603923 Closes-Bug: #1730664 --- ansible/roles/common/tasks/config.yml | 10 +- ...ewrite.conf.j2 => 01-rewrite-0.12.conf.j2} | 0 .../conf/filter/01-rewrite-0.14.conf.j2 | 154 ++++++++++++++++++ 3 files changed, 160 insertions(+), 4 deletions(-) rename ansible/roles/common/templates/conf/filter/{01-rewrite.conf.j2 => 01-rewrite-0.12.conf.j2} (100%) create mode 100644 ansible/roles/common/templates/conf/filter/01-rewrite-0.14.conf.j2 diff --git a/ansible/roles/common/tasks/config.yml b/ansible/roles/common/tasks/config.yml index 863c37917b..1e89d48eb4 100644 --- a/ansible/roles/common/tasks/config.yml +++ b/ansible/roles/common/tasks/config.yml @@ -106,14 +106,16 @@ - name: Copying over fluentd filter config files template: - src: "conf/filter/{{ item }}.conf.j2" - dest: "{{ node_config_directory }}/fluentd/filter/{{ item }}.conf" + src: "conf/filter/{{ item.src }}.conf.j2" + dest: "{{ node_config_directory }}/fluentd/filter/{{ item.dest }}.conf" mode: "0660" become: true register: fluentd_filter with_items: - - "00-record_transformer" - - "01-rewrite" + - src: 00-record_transformer + dest: 00-record_transformer + - src: "{{ '01-rewrite-0.14' if kolla_base_distro in ['debian', 'ubuntu'] else '01-rewrite-0.12' }}" + dest: 01-rewrite when: enable_fluentd | bool notify: - Restart fluentd container diff --git a/ansible/roles/common/templates/conf/filter/01-rewrite.conf.j2 b/ansible/roles/common/templates/conf/filter/01-rewrite-0.12.conf.j2 similarity index 100% rename from ansible/roles/common/templates/conf/filter/01-rewrite.conf.j2 rename to ansible/roles/common/templates/conf/filter/01-rewrite-0.12.conf.j2 diff --git a/ansible/roles/common/templates/conf/filter/01-rewrite-0.14.conf.j2 b/ansible/roles/common/templates/conf/filter/01-rewrite-0.14.conf.j2 new file mode 100644 index 0000000000..30467357a4 --- /dev/null +++ b/ansible/roles/common/templates/conf/filter/01-rewrite-0.14.conf.j2 @@ -0,0 +1,154 @@ + + @type rewrite_tag_filter + capitalize_regex_backreference yes + + key programname + pattern ^(cinder-api-access|cloudkitty-api-access|gnocchi-api-access|horizon-access|keystone-apache-admin-access|keystone-apache-public-access|placement-api-access|panko-api-access)$ + tag apache_access + + + key programname + pattern ^(aodh_wsgi_access|barbican-api|zun_api_wsgi_access)$ + tag wsgi_access + + + key programname + pattern ^(nova-api|nova-compute|nova-compute-ironic|nova-conductor|nova-consoleauth|nova-manage|nova-novncproxy|nova-scheduler|nova-placement-api|placement-api|privsep-helper)$ + tag openstack_python + + + key programname + pattern ^(sahara-api|sahara-engine)$ + tag openstack_python + + + key programname + pattern ^(neutron-server|neutron-openvswitch-agent|neutron-ns-metadata-proxy|neutron-metadata-agent|neutron-l3-agent|neutron-dhcp-agent)$ + tag openstack_python + + + key programname + pattern ^(magnum-conductor|magnum-api)$ + tag openstack_python + + + key programname + pattern ^(keystone)$ + tag openstack_python + + + key programname + pattern ^(heat-engine|heat-api|heat-api-cfn)$ + tag openstack_python + + + key programname + pattern ^(glance-api|glance-registry)$ + tag openstack_python + + + key programname + pattern ^(cloudkitty-storage-init|cloudkitty-processor|cloudkitty-dbsync|cloudkitty-api)$ + tag openstack_python + + + key programname + pattern ^(ceilometer-polling|ceilometer-agent-notification)$ + tag openstack_python + + + key programname + pattern ^(barbican-worker|barbican-keystone-listener|barbican-db-manage|app)$ + tag openstack_python + + + key programname + pattern ^(aodh-notifier|aodh-listener|aodh-evaluator|aodh-dbsync)$ + tag openstack_python + + + key programname + pattern ^(cinder-api|cinder-scheduler|cinder-manage|cinder-volume|cinder-backup|privsep-helper)$ + tag openstack_python + + + key programname + pattern ^(mistral-server)$ + tag openstack_python + + + key programname + pattern ^(designate-api|designate-central|designate-manage|designate-mdns|designate-sink|designate-worker)$ + tag openstack_python + + + key programname + pattern ^(manila-api|manila-data|manila-manage|manila-share|manila-scheduler)$ + tag openstack_python + + + key programname + pattern ^(trove-api|trove-conductor|trove-manage|trove-taskmanager)$ + tag openstack_python + + + key programname + pattern ^(congress-server)$ + tag openstack_python + + + key programname + pattern ^(murano-api|murano-engine)$ + tag openstack_python + + + key programname + pattern ^(senlin-api|senlin-engine)$ + tag openstack_python + + + key programname + pattern ^(watcher-api|watcher-applier|watcher-db-manage|watcher-decision-engine)$ + tag openstack_python + + + key programname + pattern ^(freezer-api|freezer-api_access|freezer-manage)$ + tag openstack_python + + + key programname + pattern ^(octavia-api|octavia-health-manager|octavia-housekeeping|octavia-worker)$ + tag openstack_python + + + key programname + pattern ^(zun-api|zun-compute)$ + tag openstack_python + + + key programname + pattern ^(kuryr-server)$ + tag openstack_python + + + key programname + pattern ^(gnocchi-api|gnocchi-statsd|gnocchi-metricd|gnocchi-upgrade)$ + tag openstack_python + + + key programname + pattern ^(ironic-api|ironic-conductor)$ + tag openstack_python + + + key programname + pattern ^(panko-api|panko-dbsync)$ + tag openstack_python + + + key programname + pattern ^(tacker-server|tacker-conductor)$ + tag openstack_python + +