Unexpected behavior - bug or user error?

47 views
Skip to first unread message

Don Jackson

unread,
Jan 19, 2015, 6:29:56 PM1/19/15
to ansible...@googlegroups.com

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 <module>
    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?


Brian Coca

unread,
Jan 19, 2015, 6:55:15 PM1/19/15
to ansible...@googlegroups.com
it assumes values are all strings, it is a bug.


--
Brian Coca
Reply all
Reply to author
Forward
0 new messages