copy contents of registered variable to other hosts
Solution 1:
when: "'prometheus1' in inventory_hostname"
This is only running the task when the hostname matches prometheus1, and explains why you're getting it only on the prometheus1 host.
when: "'prometheus1' in inventory_hostname"
This is only running the task when the hostname matches prometheus1, and explains why you're getting it only on the prometheus1 host.