Setup kafka reactor for managing kafka controllers globally

Signed-off-by: reyesj2 <94730068+reyesj2@users.noreply.github.com>
This commit is contained in:
reyesj2
2024-04-22 16:42:59 -04:00
parent 4ac04a1a46
commit 25d63f7516
5 changed files with 45 additions and 0 deletions

16
salt/reactor/kafka.sls Normal file
View File

@@ -0,0 +1,16 @@
{# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one
or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at
https://securityonion.net/license; you may not use this file except in compliance with the
Elastic License 2.0. #}
{% set minionid = data['id'].split('_')[0] %}
{% set role = data['data']['process_x_roles'] %}
{# Run so-yaml to replace kafka.node.<minionID>.role with the value from kafka/controllers.sls #}
update_global_kafka_pillar:
local.cmd.run:
- tgt: 'G@role:so-manager or G@role:so-managersearch or G@role:so-standalone'
- tgt_type: compound
- arg:
- '/usr/sbin/so-yaml.py replace /opt/so/saltstack/local/pillar/kafka/nodes.sls kafka.nodes.{{ minionid }}.role {{ role }}'