I'm using lineinfile
to update a configuration file. The file exists and the ansible_ssh_user
owns it and has write permission, but the containing directory is owned by root
. When my task runs I the error:
The destination directory (/parent/directory/name) is not writable by the current user.
I can edit the file by hand using vim
, and my lineinfile
task includes create=no
, so I don't understand why Ansible needs write permission to the parent directory. Is there something I'm missing? Is there a way to allow ansible to write the to the file without granting permissions to the directory it's in?
PS - I really don't want to use become
or sudo
with this playbook; it's intended to a simple playbook without having to type in a password.