I wanted to configure some sudo rules using puppet.
The default sudo config has an directory called /etc/sudoers.d which makes dropping in the actual entries rather easy:
file { "/etc/sudoers.d/example" :
ensure => present,
owner => 'root',
group => 'root',
mode => 0440,
content => template('example/sudo.erb'),
}
but alas, the default RHEL6 sudo has requiretty set which prevented my sudo rules from working correctly.
Naturally I wanted to use augeas to remove that flag but it turned into a nightmare trifecta of puppet + augeas + sudo. Three tools with so much potential and a great lack of real world documentation.
I remember having battled with this before and giving up. This time I was determined to succeed. I revisited the only information on the internet but I still could not get it to work. After looking at the code for the sudo lens I was pretty sure that I had the correct version and eventually I was pointed in the right direction. Instead of removing the requiretty I needed to negate it. After some more mucking around I came up with a working incantation:
augeas { "turn off sudo requiretty":
changes => [
'set /files/etc/sudoers/Defaults[*]/requiretty/negate ""',
],
}
I hope that will be of use to someone.
Thanks, that helped me a lot!
ReplyDeleteThanks!
ReplyDeleteThis is also a very good post which I really enjoyed reading. It is not everyday that I have the possibility to see something like this.
ReplyDeleteSushi Cat 2
feel regret I did not know this before I read your article.
ReplyDeletesuperfighters
happy room
Hi, Generally I use templates to maintain sudoers, but I tried to implement in augeas just to understand augeas better and also it worked for few ...
ReplyDeletedownload for android
The ultimate goal of online sociology research paper writing services is to provide Sociology Assignment Writing Services and sociology essay writing services since most sociology term paper writing service students lack time to complete their custom sociology coursework writing services.
ReplyDeleteThank you very much for giving us to express our feeling and thoughts about above information. I think you will keep updating and changing these information time to time if there is need to change. Internal Auditing Consulting Services India, Ind AS Implementation in India, Tax Consultancy Services In India, Accounting Services In Delhi, Top Ca Firms, Gst Registration In Delhi Online , Business Advisory Services For Small And Medium Enterprises, Company Compliance And Advisory Services India.
ReplyDeleteThanks for this blog. It really provides awesome information to all readers. keep it up and keep posting these types of blogs on digital marketing services, it's really helpful.
ReplyDeleteinternal audit firms in india