How Do You Troubleshoot the Ansible Problem “IOError: [Errno 13] Permission denied…”?

Problem scenario
You are running an Ansible playbook, but you get an error like this:  "IOError: [Errno 13] Permission denied..."

How do you get the playbook to work?

Solution
If the playbook has a destination for a file and that file is already there on the managed node, this error may occur. 

1.  Go to the managed node. 
2.  Consider these four possible solutions:

  • Change the destination of the file in the playbook.
  • Move the file that is already in the destination file's place on the managed node to a different location.
  • Delete the file from the managed node.
  • Change the permissions of the destination directory on the managed node (either manually or via the Ansible playbook).

Leave a comment

Your email address will not be published. Required fields are marked *