Giter Club home page Giter Club logo

Comments (6)

ahuffman avatar ahuffman commented on June 1, 2024

@jph Does your user have sudo access to visudo in your sudoers config?

from ansible-sudoers.

cocampbe avatar cocampbe commented on June 1, 2024

I am having a similar issue. I use a playbook in which I use become_method=su. I use a -K to prompt for the su password. It always fails at this task: Ensure all authorized separate sudoer specs are properly configured. The user at this point should be root. I am having a hard time figuring out why root would not be able to validate the temp file.

from ansible-sudoers.

cocampbe avatar cocampbe commented on June 1, 2024

Just ran again with ANSIBLE_KEEP_REMOTE_FILES=1. The temp file looks good and has the correct data. I walk also able to manually validate the file.

visudo -cf /home/[email protected]/.ansible/tmp/ansible-tmp-1554835420.25-38260832755142/source
/home/[email protected]/.ansible/tmp/ansible-tmp-1554835420.25-38260832755142/source: parsed OK

from ansible-sudoers.

cocampbe avatar cocampbe commented on June 1, 2024

I think I understand what is happening. The template file is created with root:root 440 permissions. I think the validate is being run as the user running ansible and not root. I would think that would be "Permission denied", but I need to examine this further. going to change the mode to 444 for the template file.

Did not work. The user can read the file now. But still [Errno 2] No such file or directory. Maybe the module or something with popen.subprocess.

from ansible-sudoers.

cocampbe avatar cocampbe commented on June 1, 2024

FWIW, if you comment out the validate options it works. Something with the validate option and become are not cooperating. It's not the solution, but at least a starting point.

from ansible-sudoers.

cocampbe avatar cocampbe commented on June 1, 2024

Resolved. Change the validate to use absolute path.

validate: '/usr/sbin/visudo -cf %s'

This should work for EL6 and EL7 variants.

from ansible-sudoers.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.