Obtaining root privileges inaccessible

I have the following task out of reach:

- file: "state=directory path=/servers/repo" sudo: yes name: "Create the base site directory." 

which should be run as my user, but with root privileges. But even if my user is 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 on the server, I have all the permissions, but somehow with the impossibility of its operation.

Any idea why?

+4
linux ansible ansible-playbook
source share
2 answers

The problem was that I did not have permission to run / bin / sh. I needed to install the executable in / bin / bash - this can be done in an indispensable configuration file. Therefore, in the current directory, I created the ansible.cfg file with the following contents:

 executable = /bin/bash 

and it was!

+3
source share

It looks like you do not have full sudo access, due to which some teams fail with Ansible. Can you try running the commands below with sudo and see if you can successfully execute it on the remote host?

 /bin/sh echo /usr/bin/python rm 

If any of these actions does not work, you should add this command to the sudoers file.

+1
source share

All Articles