Ted Timmons
unread,Apr 24, 2015, 8:01:22 AM4/24/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
I'm trying to calculate a serial number and having trouble. I'm unsure
of the jinja filter pipeline. Here's what I'm trying:
serial: "{{play_hosts|length|float/2|round(0, 'ceil')|int}}"
here's the error:
ValueError: invalid literal for int() with base 10:
"{{default(length(play_hosts), 1)/2|round(0, 'ceil')|int}}"
If I put that jinja string in a debug, it is ending with a float- for
instance, if there are 10 play_hosts, the output is 5.0. That seems
strange given the 'int'. I wonder if that's what is causing it to
fail.
-ted