Unexpected behavior - bug or user error?

While attempting to use the sysctl module like this:

sysctl:
name: vm.swappiness
value: 0
state: present
reload: true

I got the following error:

TASK: [Ensure vm.swappiness is set to 0] **************************************

failed: [mgmt] => {“failed”: true, “parsed”: false}

SUDO-SUCCESS-urhsorhzrlftxcytlkatmfbrbjzbfqcj

Traceback (most recent call last):

File “/home/ds/.ansible/tmp/ansible-tmp-1421708908.33-97939341875354/sysctl”, line 1899, in

main()

File “/home/ds/.ansible/tmp/ansible-tmp-1421708908.33-97939341875354/sysctl”, line 327, in main

result = SysctlModule(module)

File “/home/ds/.ansible/tmp/ansible-tmp-1421708908.33-97939341875354/sysctl”, line 118, in init

self.process()

File “/home/ds/.ansible/tmp/ansible-tmp-1421708908.33-97939341875354/sysctl”, line 128, in process

self.args[‘value’] = self._parse_value(self.args[‘value’])

File “/home/ds/.ansible/tmp/ansible-tmp-1421708908.33-97939341875354/sysctl”, line 188, in _parse_value

elif value.lower() in BOOLEANS_TRUE:

AttributeError: ‘int’ object has no attribute ‘lower’

If I quote the value, e.g. ‘0’, it then works.

Is this the expected behavior, or is this a bug?

it assumes values are all strings, it is a bug.