I have the following task in ansible:
- file: "state=directory path=/servers/repo"
sudo: yes
name: "Create the base site directory."
which should run as my user but with root privileges. But even though my user is a sudoer it fails with
Sorry, user sofiab is not allowed to execute '/bin/sh -c echo SUDO-SUCCESS-amlzcqzchzpjsgkllckjhjfednpjgevj; LANG=C LC_CTYPE=C /usr/bin/python /home/sofiab/.ansible/tmp/ansible-tmp-1409321488.66-202796192861545/file; rm -rf /home/sofiab/.ansible/tmp/ansible-tmp-1409321488.66-202796192861545/ >/dev/null 2>&1' as root
Of course, when i do sudo -s in the server i have all the right permissions but somehow with ansible it's not working.
Any idea why?