On 11/12/18 6:07 pm, Kai Stian Olstad wrote:
> On 10.12.2018 23:26, Stuart Longland wrote:
>>> encrypted: "{{hostvars[item].get('encrypted','false') ==
>>> 'true'}}"
>>> volume_size: "{{hostvars[item].get('volume_size',100) | int}}"
>>> volume_type: "{{hostvars[item].get('volume_type','gp2')}}"
>>
>> I got the same error.
>>
>> I suspect that the integer is then getting cast *back* to a string
>> before being passed onto `boto3`, which is then barfing on it.
>
> You could try to do it the Ansible way and not the Python way to see if
> that works.
>
> volume_size: "{{hostvars[item].volume_size | default(100) | int}}"
>
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}}
I'd try it out, but I've now hit a second issue with `ec2_instance`, and
that is it keeps insisting on modifying the *existing* instance I
created for a customer instead of creating a *new* instance like I
intended. (This is in spite of the customer instance being a
"t3.xlarge", and my new instance having a type of "t3.nano".)
How does one tell `ec2_instance` to "leave the existing instance(s)
alone and create a new one"?
--
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/c88df668-4f3d-70f5-7bed-9c83831a6db3%40longlandclan.id.au.
For more options, visit https://groups.google.com/d/optout.