how to run perticular dependency role for specific host group

Hello Team,

We have below grafana agent play.yaml and inside dependency we have mentioned below content now issue is kafka_exporter role runs on all hosts. We want only to run on broker host how to achieve it??

grafana-agent-play.yaml

  • name: “GRAgent Play”

hosts: all:!localhost

strategy: linear

order: sorted

become: no

gather_facts: True

See bug https://github.com/grafana/grafana-ansible-collection/issues/153 for parallel runs.

serial:

  • 3

  • 25%

  • 50%

  • 100%

vars:

ansible_remote_tmp: /tmp

tasks:

  • name: Run roles under dependencies

ansible.builtin.include_role:

name: “{{ dependent_role }}”

with_items: “{{ dependencies }}”

loop_control:

loop_var: dependent_role

tags: [‘always’, ‘install’]

dependencies.yaml

Don't use dependencies, use include_role and make it conditional

Thanks Brian.
so there is no possibility to achieve with dependencies ryt??