lineinfile error "NameError: global name 'is_quoted' is not defined"

33 views
Skip to first unread message

ser...@sudakovich.com

unread,
Apr 24, 2015, 7:31:00 PM4/24/15
to ansible...@googlegroups.com
When using lineinfile, I get this kind of an error:

TASK: [Enable/Disable watchdog] ***********************************************
failed: [dni-7448-35] => {"failed": true, "parsed": false}
invalid output was: Traceback (most recent call last):
  File "/home/cumulus/.ansible/tmp/ansible-tmp-1429913951.55-31782322592167/lineinfile", line 1917, in <module>
    main()
  File "/home/cumulus/.ansible/tmp/ansible-tmp-1429913951.55-31782322592167/lineinfile", line 370, in main
    should_unquote = not is_quoted(line)
NameError: global name 'is_quoted' is not defined


FATAL: all hosts have already failed -- aborting

the task looks like so:
    - name: Enable/Disable watchdog
      lineinfile: dest=/etc/watchdog.d/platform line="run_watchdog={{ run_watchdog }}" state=present
      when: run_watchdog is defined

Ansible version is 1.7

Anybody knows how to fix this?

Toshio Kuratomi

unread,
Apr 26, 2015, 9:36:33 PM4/26/15
to ansible...@googlegroups.com

Looking at the code in the git repo it looks like it's fixed as of 1.7.1

The lineinfile module needs to have

from ansible.module_utils.splitter import *

Near the bottom of the file.

-Toshio

Reply all
Reply to author
Forward
0 new messages