I have the following task:
`
- name: create tmp dir to copy db sql to
file: path=/tmp/sql state=directory
`
When I run it, I get the error:
`
TASK [mysql-data : create tmp dir to copy db sql to] ***************************
fatal: [default]: FAILED! => {“changed”: false, “failed”: true, “gid”: 0, “group”: “root”, “mode”: “0644”, “msg”: “/tmp/sql already exists as a file”, “owner”: “root”, “path”: “/tmp/sql”, “size”: 794097, “state”: “file”, “uid”: 0}
`
The file /tmp/sql does exist, so the error is correct in that /tmp/sql already exists as a file, but in the task I’m specifying that the directory /tmp/sql should exist, not a file (and if it did exist it shouldn’t be throwing an error anyway).
This is with ansible 2.3.1.0 and python version = 2.7.6 on an Ubuntu 14.04.5 VM. (On a windows host, but /tmp isn’t mapped to the host file system).
Anyone know what the problem is?