From b76f40166ac0d30439552bd8079b8029cd0601c9 Mon Sep 17 00:00:00 2001 From: Doug Szumski Date: Fri, 8 Jun 2018 12:22:21 +0100 Subject: [PATCH] Supporting configuring Monasca Kafka topics Multiple Monasca services will need to access these topics. We can use these variables to make sure that they all use the correct ones. Change-Id: I9f40090287542a78dc7d7c6bdd3933abb32918d7 Partially-Implements: blueprint monasca-roles --- ansible/roles/monasca/defaults/main.yml | 3 +++ ansible/roles/monasca/templates/monasca-api/api-config.conf.j2 | 1 + .../roles/monasca/templates/monasca-log-api/log-api.conf.j2 | 2 ++ 3 files changed, 6 insertions(+) diff --git a/ansible/roles/monasca/defaults/main.yml b/ansible/roles/monasca/defaults/main.yml index d392153814..ac81421296 100644 --- a/ansible/roles/monasca/defaults/main.yml +++ b/ansible/roles/monasca/defaults/main.yml @@ -36,6 +36,9 @@ monasca_influxdb_http_port: "{{ influxdb_http_port }}" monasca_kafka: "{% for host in groups['kafka'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ kafka_port }}{% if not loop.last %},{% endif %}{% endfor %}" monasca_memcached_servers: "{% for host in groups['memcached'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ memcached_port }}{% if not loop.last %},{% endif %}{% endfor %}" +monasca_metrics_topic: "metrics" +monasca_raw_logs_topic: "logs" + #################### # Docker #################### diff --git a/ansible/roles/monasca/templates/monasca-api/api-config.conf.j2 b/ansible/roles/monasca/templates/monasca-api/api-config.conf.j2 index d05e38f961..d78c1c7a9f 100644 --- a/ansible/roles/monasca/templates/monasca-api/api-config.conf.j2 +++ b/ansible/roles/monasca/templates/monasca-api/api-config.conf.j2 @@ -14,6 +14,7 @@ ip_address = {{ monasca_influxdb_address }} port = {{ monasca_influxdb_http_port }} [kafka] +metrics_topic = {{ monasca_metrics_topic }} partitions = 0 uri = {{ monasca_kafka }} diff --git a/ansible/roles/monasca/templates/monasca-log-api/log-api.conf.j2 b/ansible/roles/monasca/templates/monasca-log-api/log-api.conf.j2 index 82fe7e68de..c542060a20 100644 --- a/ansible/roles/monasca/templates/monasca-log-api/log-api.conf.j2 +++ b/ansible/roles/monasca/templates/monasca-log-api/log-api.conf.j2 @@ -4,9 +4,11 @@ log_dir = /var/log/kolla/monasca debug = {{ monasca_logging_debug }} [kafka_healthcheck] +kafka_topics = {{ monasca_raw_logs_topic }} kafka_url = {{ monasca_kafka }} [log_publisher] +topics = {{ monasca_raw_logs_topic }} kafka_url = {{ monasca_kafka }} [monitoring]