Closed fduranti closed 6 years ago
I've moved the check of the global sudo so that it will only be executed on a refresh (it's the same check that do the remove file without file remove)
Can you please rebase this PR?
I'll try to do it tomorrow or the day after.
@saz I've done the rebase but probably some checks should be changed to as the exec command can be different. I can try to change them and push the new commit but I'm not so good at programming testing (and running the test locally). Can you help me with this?
@saz I was able to do some changing on the tests and now it should be ok.
@saz any problem with this PR? This should be ok now
@saz Anything I can do with this PR / change request or it will never be merged/took in consideration?
@fduranti If you're able to rebase it, it would be awesome!
@saz I'll try to do it for tomorrow or the day after. I'm also putting 2 more changes so that the default behaviour of sudo module will remain the same of the actual version also after the PR. 1- the default action for failed visudo -c run will be to delete the file 2- there will be an option to enable to run the file validate_cmd for single sudoers.d file checking
@saz done some changes and the rebase. This is the description: Change the way visudo checks are done with 2 options.
The 2 options are $delete_on_error and $validate_single.
If $delete_on_error is true the configuration is deleted if visudo -c return an error. If false the error will be only notified but the file will not be deleted. Default is true
if $validate_single is true the file resource will run with validate_cmd to test the single files and if there's an error the old file will not be substituted or deleted. Default is false
@saz this should be now ok and ready to be merged.
Change the way visudo checks are done with 2 options.
The 2 options are $delete_on_error and $validate_single.
If $delete_on_error is true the configuration is deleted if visudo -c return an error. If false the error will be only notified but the file will not be deleted. Default is true
if $validate_single is true the file resource will run with validate_cmd to test the single files and if there's an error the old file will not be substituted or deleted. Default is false
Will help with #184 and #125