Reputation: 13
Really short question. I just wanted to know why when we use handlers the "listen" section doesn't take variable?
- name: notify components
command: echo "this task will notify all the components"
notify: "hello world"
- debug:
msg: "Hello world !!"
listen: "hello world"
- set_fact:
myvar: "hello world"
listen: "hello world"
- debug:
msg: "Hello world !! with var"
listen: "{{myvar}}"
Why this section doesn't work? Listen doesn't take variables?
Upvotes: 1
Views: 1997
Reputation: 44615
This is specifically documented in the notes on handlers documentation
Handler names are templatable and listen topics are not.
Upvotes: 1