blob: fe57ef28ec32e419f70251a72844962208971bf3 [file] [log] [blame]
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
---
- name: Distribute bro-kafka plugin
copy: src=../../../metron-sensors/bro-plugin-kafka dest=/tmp/ mode=0755
- name: Compile and install the plugin
shell: "{{ item }}"
args:
chdir: "/tmp/bro-plugin-kafka"
creates: "{{ bro_home }}/lib/bro/plugins/BRO_KAFKA"
with_items:
- rm -rf build/
- "./configure --bro-dist=/tmp/bro-{{ bro_version }} --install-root={{ bro_home }}/lib/bro/plugins/ --with-librdkafka={{ librdkafka_home }}"
- make
- make install
- name: Configure bro-kafka plugin
lineinfile:
dest: "{{ bro_home }}/share/bro/site/local.bro"
line: "{{ item }}"
with_items:
- "@load Bro/Kafka/logs-to-kafka.bro"
- "redef Kafka::logs_to_send = set(HTTP::LOG, DNS::LOG);"
- "redef Kafka::topic_name = \"{{ bro_topic }}\";"
- "redef Kafka::tag_json = T;"
- "redef Kafka::kafka_conf = table([\"metadata.broker.list\"] = \"{{ kafka_broker_url }}\");"
- name: Deploy bro configuration changes
shell: "{{ bro_home }}/bin/broctl deploy"