opennms-forge / ansible-opennms

Deployment of OpenNMS components in your infrastructure using Ansible
GNU General Public License v3.0
3 stars 5 forks source link

🪲 Minion role does not define sink topic configuration #49

Open indigo423 opened 5 months ago

indigo423 commented 5 months ago

The Ansible role for the Minion does not define anything for the sink configuration, only for IPC.

indigo423 commented 5 months ago

@bmgante The opennms_minion_kafka dictionary should allow you to configure any arbitrary key/value property in the IPC configuration on the Minion. You should be able to configure it like this:

opennms_minion_kafka:
  "bootstrap.servers": localhost:9092
  "org.opennms.activemq.broker.disable": True
  "org.opennms.core.ipc.strategy": kafka
  "org.opennms.core.ipc.sink.kafka.group.id": Labmonkeys-HQ-Core-Sink
  "org.opennms.core.ipc.sink.initialSleepTime": 60000
  "org.opennms.core.ipc.twin.kafka.group.id": Labmonkeys-HQ-Core-Twin
  "org.opennms.core.ipc.rpc.kafka.group.id": Labmonkeys-HQ-Core-RPC
  "org.opennms.core.ipc.rpc.kafka.single-topic": True
  "org.opennms.core.ipc.rpc.kafka.ttl": 30000
bmgante commented 5 months ago

@indigo423 ok got it. The dict defines the common configuration values and we can put there anything specific to modules:

You can configure module-specific values for modules sink, rpc, and twin by replacing org.opennms.core.ipc.kafka in the config:edit command with org.opennms.core.ipc.sink.kafka, org.opennms.core.ipc.rpc.kafka, and org.opennms.core.ipc.twin.kafka, respectively. Module-specific configuration values take precedence over common configuration values.

https://docs.opennms.com/horizon/33/deployment/minion/install.html

The question in my use case is, what parameters I must configure for snmp traps to be sent from minion to horizon? Do I need all of them (sink, rpc and twin)?

Thanks

indigo423 commented 5 months ago

Ok, I understand what you mean by now. What if you want to configure each module (sink, twin, rpc) in a different configuration? It's related to the documentation hint here:

You can configure module-specific values for modules sink, rpc, and twin by replacing org.opennms.core.ipc.kafka in the config:edit command with org.opennms.core.ipc.sink.kafka, org.opennms.core.ipc.rpc.kafka, and org.opennms.core.ipc.twin.kafka, respectively. Module-specific configuration values take precedence over common configuration values.

We should enhance the ansible role to create individual module configurations by default. It gives users the most flexibility to configure the Kafka communication behavior. I need to double-check if it's required to have individual files for each module.

indigo423 commented 5 months ago

The question in my use case is, what parameters I must configure for snmp traps to be sent from minion to horizon? Do I need all of them (sink, rpc and twin)?

If you configure the "bootstrap.servers": localhost:9092 property sink, rpc and twin this value. In very advanced setups, you can use for the sink, rpc and twin topics different Kafka cluster.

bmgante commented 5 months ago

The question in my use case is, what parameters I must configure for snmp traps to be sent from minion to horizon? Do I need all of them (sink, rpc and twin)?

If you configure the "bootstrap.servers": localhost:9092 property sink, rpc and twin this value. In very advanced setups, you can use for the sink, rpc and twin topics different Kafka cluster.

I want to use the same kafka for all of these modules so yes, the common config which applies to all of them should be enough. Thanks @indigo423