Thursday, August 1, 2013

puppet augeas and sudo

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.

16 comments:

  1. This 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.
    Sushi Cat 2

    ReplyDelete
    Replies
    1. Osm! This post is very informative and effective. I got what I was looking for. Here to say thank you. Thanks for sharing FMWhatsapp valuable content.

      Delete
  2. feel regret I did not know this before I read your article.
    superfighters
    happy room

    ReplyDelete
  3. 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 ...

    download for android

    ReplyDelete
  4. 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.

    ReplyDelete
  5. Thanks 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.
    internal audit firms in india

    ReplyDelete
  6. Acquiring a shelf company in Cyprus is usually a simple and quick process. Companies that specialize in the sale of shelf companies offer full service. This means that, along with the company itself, they will have complete company documents, a company secretary, a registered office, nominated shareholders and directors, a company bank account with internet banking and debit cards, a sales tax identification number and even support in the first year of operation if necessary. http://www.confiduss.com/en/info/blog/article/shelf-company-cyprus/

    ReplyDelete

  7. Wonderful information! I found amazing information on the blogs i suggest everyone to follow the links below to get download files from this website.


    Fm Whatsapp

    ReplyDelete
  8. Wonderful information! I found amazing information on the blogs i suggest everyone to follow the links below to get download files from this website.Process Monitor crack

    ReplyDelete

  9. This was an excellent article. Thank you for sharing it.

    ReciaiMe Recovery>

    ReplyDelete

  10. I hope this post is beneficial for viewers. Many thanks for the shared this informative and interesting post with us.
    wondershare-recoverit

    ReplyDelete