Skip to content

Instantly share code, notes, and snippets.

@mkanoor
Created April 16, 2024 00:48
Show Gist options
  • Select an option

  • Save mkanoor/a167228c1917d4dd0a47326916c23d53 to your computer and use it in GitHub Desktop.

Select an option

Save mkanoor/a167228c1917d4dd0a47326916c23d53 to your computer and use it in GitHub Desktop.
---
- name: kafka listener
hosts: all
sources:
- name: Checked Kafka
checked: true
ansible.eda.kafka:
host: "{{ MY_KAFKA_HOST | default('localhost') }}"
topic: "{{ MY_KAFKA_TOPIC | default('demo') }}"
port: 9092
offset: latest
rules:
- name: listener ping
condition: event.body.payload.ping == "pong"
action:
none:
- name: listener shutdown
condition: event.body.payload.shutdown is defined
action:
shutdown:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment