It appears as though serial cannot be templated.  Note that you can use a
percentage there already.  So just specify 50% and I think that should
match what you want.

https://docs.ansible.com/playbooks_delegation.html#rolling-update-batch-size

On Friday, April 24, 2015, Ted Timmons <[email protected]> wrote:

> 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
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected] <javascript:;>.
> To post to this group, send email to [email protected]
> <javascript:;>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAK7GBH83jT-MRC8XhuWNsFtVNrDKNDq_otoBnxe69Bu6RDDDtQ%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Matt Martz
@sivel
sivel.net

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v9DP7oqa1Has9rvZYnbtDwi%2BRVuP2cJq%2Bhup%3DHpP2zYKw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to