Hi,
I want to write a rulebook that triggers a playbook run on some specific event. Basically I want to configure an interface of a router. My event passes all the interface data in the event.payload.data.
The core part of the runbook looks like:
action:
run_playbook:
name: set_interface.yml
extra_vars:
interface: “{{ event.payload.data }}”
The rule is triggered and the playbook starts to run. BUT the playbook does not know which host to target. The output is:
2024-03-06 15:42:52,146 - ansible_rulebook.action.run_playbook - DEBUG - Calling Ansible runner
[WARNING]: provided hosts list is empty, only localhost is available. Note that
the implicit localhost does not match ‘all’
PLAY [Test playbook] ***********************************************************
skipping: no hosts matched
How can I tell the playbook from the action, which host to target?
Michael.