# Ansible 2.8.0: Module option conversion to string

**URL:** <https://forum.ansible.com/t/ansible-2-8-0-module-option-conversion-to-string/30421>\
**Category:** Ansible Project\
**Created:** [May 25, 2019, 10:13am UTC](https://forum.ansible.com/t/ansible-2-8-0-module-option-conversion-to-string/30421 "2019-05-25T10:13:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arbab\_Nazar1](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@Arbab\_Nazar1](https://forum.ansible.com/u/Arbab_Nazar1)\
**Post date:** [May 25, 2019, 10:13am UTC](https://forum.ansible.com/t/ansible-2-8-0-module-option-conversion-to-string/30421/1 "2019-05-25T10:13:22Z")

</div>

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 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. How I can overcome this warning. Thanks

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [May 25, 2019, 10:55am UTC](https://forum.ansible.com/t/ansible-2-8-0-module-option-conversion-to-string/30421/2 "2019-05-25T10:55:11Z")

</div>

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  
> &nbsp;&nbsp;pam\_limits:  
> &nbsp;&nbsp;&nbsp;&nbsp;domain: app  
> &nbsp;&nbsp;&nbsp;&nbsp;limit\_type: "{{ item }}"  
> &nbsp;&nbsp;&nbsp;&nbsp;limit\_item: nofile  
> &nbsp;&nbsp;&nbsp;&nbsp;value: 65535  
> &nbsp;&nbsp;loop:  
> &nbsp;&nbsp;&nbsp;&nbsp;- soft  
> &nbsp;&nbsp;&nbsp;&nbsp;- 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:

> &nbsp;&nbsp;pam\_limits:  
> &nbsp;&nbsp;&nbsp;&nbsp;domain: app  
> &nbsp;&nbsp;&nbsp;&nbsp;limit\_type: "{{ item }}"  
> &nbsp;&nbsp;&nbsp;&nbsp;limit\_item: nofile  
> &nbsp;&nbsp;&nbsp;&nbsp;value: "65535"

Cheers,  
Felix
