Hi,

> Ansible 2.8.0 has introduction Module option conversion to string but 
> didn't give any example. I have simple task to set the file

that's not true: Ansible has already been doing that for a long time.
It's only since 2.8.0 that Ansible will warn about such conversions
-- which can be really dangerous, in particular in combination with
booleans.

> descriptor limits for user
> 
> - name: Set file descriptor limits for the node user
>   pam_limits:
>     domain: app
>     limit_type: "{{ item }}"
>     limit_item: nofile
>     value: 65535
>   loop:
>     - soft
>     - hard
> 
> It was working fine and didn't give any warning until 2.7.x but after 
> upgrading to ansible 2.8.0, I am getting this warning:
> 
>  [WARNING]: The value 65535 (type int) in a string field was
> converted to '65535' (type string). If this does not look like what
> you expect, quote the entire
> value to ensure it does not change.
> 
> I have changed the value part like this:
> * value: !!int 65535*
> 
> But still get the same warning.

Not a surprise, since 65535 is still an integer. The "value" option
expects a string.

> How I can overcome this warning.

So you have to quote the value (as the warning says) to make it a
string:

>   pam_limits:
>     domain: app
>     limit_type: "{{ item }}"
>     limit_item: nofile
>     value: "65535"

Cheers,
Felix


-- 
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/20190525125511.0f792f81%40rovaniemi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to