Comments (6)
@jph Does your user have sudo access to visudo in your sudoers config?
from ansible-sudoers.
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.
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.
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.
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.
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)
- Last merged PR erase previous change HOT 2
- "--check"-mode run fails due to undefined existing_sudoer_spec_list
- Role fails with "AnsibleUndefinedVariable: 'dict object' has no attribute 'iteritems'" HOT 2
- Role nuked my /etc/sudoers.d, yet doco states it shouldn't have HOT 1
- "--check"-mode run fails due to undefined sudoers_includes_separate_specs.stdout HOT 1
- Ansible 2.5 slice filter error HOT 5
- Error while running playbook
- Defining roles in different files HOT 3
- sudoer_remove_unauthorized_specs should default to False
- command and user aliases are not created inside sudoers.d HOT 1
- Builds fail in Travis, and we should move the testing to molecule
- Feature request - Would love to do this in reverse HOT 3
- ownership of local backup directory
- explicit 'become: False' in task 'Ensure local backup directory exists' HOT 9
- Provide dependencies information
- Any plan to publish collection?
- Error 'NoneType' object is not iterable with minimal role parameters HOT 11
- Semantic versioning HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-sudoers.