Hello,
It seems that I found a bug with the lineinfile module:
- name: lineinfile fails with a path only containing a file name
lineinfile: dest=afile regexp=“something” line=“something”
It fails with an error like:
failed: [iterativeocean.biz] => {“failed”: true, “item”: “”, “parsed”: false}
invalid output was: Traceback (most recent call last):
File “/home/pierre/.ansible/tmp/ansible-1378933589.79-184488600904880/lineinfile”, line 1255, in
main()
File “/home/pierre/.ansible/tmp/ansible-1378933589.79-184488600904880/lineinfile”, line 319, in main
ins_aft, ins_bef, create, backup, backrefs)
File “/home/pierre/.ansible/tmp/ansible-1378933589.79-184488600904880/lineinfile”, line 163, in present
os.makedirs(destpath)
File “/usr/lib/python2.7/os.py”, line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 2] No such file or directory: ‘’
So, in that case, the directory is empty.