phinze / puppet-sudoers

puppet module for managing sudoers
MIT License
8 stars 9 forks source link

Where to store the declaration #13

Open klm46 opened 8 years ago

klm46 commented 8 years ago

Hi, i just got a problem with where to put the declaration as in your description. I added my content in "allowed_command.pp" (tried pretty the same as here for beginning) but a puppet run does not take any effect. I did not change anything at the files, in the site.pp at the top of puppet, i included this module. This is ok. But why my data does not be done? And no file at /etc/sudoers.d/ will be created. Puppetrun ends without error.

sudoers::allowed_command{ "acme": command => "/usr/sbin/service", user => "acme", require_password => false, comment => "Allows access to the service command for the acme user" }

tspeigner commented 7 years ago

You should create your own module and then use this module to to the process the inputs.

Create: /etc/puppetlabs/code/environments/production/mymodule/manifests

/etc/puppetlabs/code/environments/production/mymodule/manifests/init.pp

Add to init.pp: class mymodule { sudoers::allowed_command{ "acme": command => "/usr/sbin/service", user => "acme", require_password => false, comment => "Allows access to the service command for the acme user" } }

This is only an example. But that should help you use this module with your own.

klm46 commented 7 years ago

thanks man - i was really husseling for that - and i forgot to say thank you ;)

tspeigner commented 7 years ago

glad that it worked out for you. it can be tricky on where to put things. happy puppetizing!