My custom filter plugin uses ansible.utils.display
to inject a warning in Ansible's output in some circumstances:
if 'hold' in mydetails:
display.warning('%s can be upgraded from %s to %s, but is on hold' %
(myp, mydetails['version'], latest))
continue
This works and the warning is displayed nicely, but lacks the hostname -- which could get rather confusing, when one's inventory is large. I could insert the hostname there myself, but I want to use exactly the string already known as inventory_hostname
. How would I access that variable?
0 Answers