On 12/12/18 4:26 pm, Kai Stian Olstad wrote:
>> I understood Ansible basically used the Python language within Jinja2.
>> What's the difference between these two lines?
>>
>>      {{hostvars[item].volume_size | default(100) | int}}
>>      {{hostvars[item].get('volume_size',100) | int}}
> All software have bugs and the Ansible way is probably used by most and have 
> therefore been thoroughly tested.
> So the easiest way to check that out is to test it.

As explained, I'm unable to test because `ec2_instance` tries to clobber
an existing instance instead of creating a new one.

I also see that both call the `| int` filter in `jinja2`.  So assuming
`jinja2` is doing its job, the return value in *both* cases should be an
`int`.  `boto3` thinks though it is getting a `str`, which leads me to
believe something in between `jinja2` and `boto3` is casting it *back*
to a `str`.

>From `jinja2`'s perspective, there's no such thing as the "Ansible way",
it's *all* Python.  I therefore have trouble understanding what's
happening behind the scenes.
-- 
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
  ...it's backed up on a tape somewhere.

-- 
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/b64172f1-3ab5-82f1-f51f-d59bc339e248%40longlandclan.id.au.
For more options, visit https://groups.google.com/d/optout.

Reply via email to