OOC, can you try single quotes? Just curious if that makes any difference...

./Alex

On Tuesday, 28 June 2016, Barry Kaplan <meme...@gmail.com> wrote:

> I thought one of the big improvements in 2.x was not blindly casting
> nested values to strings:
>
> vars:
>   a_var_number: 200
>
> tasks:
>   - mymodule:
>     module_args:
>       a_fixed_number: 100
>       a_var_number: "{{ a_number }}"
>       a_var_number_with_cast: "{{ a_number | int }}"
>
>
> Inside the module module_args dict gets:
>
>     module = AnsibleModule(
>         argument_spec=dict(
>                    module_args=dict(required=True, type='raw')
>         ),
>     )
>
>     args = module.params['module_args']
>     is_num_1 = isinstance(args['a_fixed_number'], int)         # True
>     is_num_2 = isinstance(args['a_var_number'], int)           # False
>     is_num_3 = isinstance(args['a_var_number_with_cast'], int) # False
>
>
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com
> <javascript:_e(%7B%7D,'cvml','ansible-project%2bunsubscr...@googlegroups.com');>
> .
> To post to this group, send email to ansible-project@googlegroups.com
> <javascript:_e(%7B%7D,'cvml','ansible-project@googlegroups.com');>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/ab0c1187-6552-4e02-ba43-2338d23ab889%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/ab0c1187-6552-4e02-ba43-2338d23ab889%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACSH3MvdLUTHnv_bQ%2BimzBAB9%3DBuyaBAa7gk3%2Bd9hM_JHm4-%2BQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to