Config Template jinja2 with ipaddr / netaddr #12561
-
Hi, I'm trying to do some IP calculations with config templates, but i'm not able to use ipaddr / netaddr. Is the jinja2 filter not usable by default? Should I add it to the JINJA2_FILTERS? Jinja2 Example to print the variable
Output Render Config
Jinja2 Example to only print the IP
Output Render Config Error
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
The In your specific case you should also just be able to do |
Beta Was this translation helpful? Give feedback.
The
ipaddr
filter seems to be an ansible thing. You can add it in JINJA2_FILTERS yeah.In your specific case you should also just be able to do
{{ ip.address.ip }}