On 3/30/15 2:50 PM, manyi wrote:
> Thanks for the responds Russel,
> responding to where the sudo class /module is from, I created it
> any pointers???
> 
> 
> 
> On Saturday, March 28, 2015 at 10:40:20 AM UTC-4, Russell Anderson wrote:
> 
>     First, the visudo check didn't work otherwise it would have given
>     actual feedback, not usage info. 
> 
>     Second, where is this sudo class / module come from.  Nothing in the
>     command snippets creates it. 
> 
>     On Friday, March 27, 2015 at 3:24:58 PM UTC-4, manyi wrote:
> 
>         Help needed!!
> 
>         I am trying to add 2 users to /ect/sudoers john.smith and
>         jane.may granting privileges to all servers
> 
>         _*step 1. *__*modules/user/manifests/init.pp *_
> 
> 
>         class user {
> 
>          user { 'john.smith':
> 
>          ensure => present,
> 
>          comment => 'john.smith',
> 
>          home => '/home/john.smith',
> 
>          managehome => true
> 
>            }
> 
>         }
> 
> 
>         _*Step 2  manifests/site.pp*_
> 
>          
> 
>         /etc/puppet/manifests/site.pp
> 
>         node 'mydomain.local.org <http://mydomain.local.org>'
> 
>          { include user }
> 
> 
>         _*step 3 :*_ sudo mkdir -p modules/sudoers/manifests
> 
>         _*Step 4*_   sudo mkdir -p modules/sudoers/files
> 
>         step 5 
> 
>         Create the file modules/sudoers/manifests/init.pp
> 
>         # Manage the sudoers file
> 
>          class sudoers {
> 
>         file { '/etc/sudoers':
> 
>          source => 'puppet:///modules/sudoers/sudoers'
> 
>          mode => '0440',
> 
>         owner => 'root',
> 
>          group => 'root',
> 
>            }
> 
>         }
> 
> 
>         _*Step 6 *_Check the syntax of the sudoers file
> 
>         visudo -c -f modules/sudoers/files/sudoers
>         modules/sudoers/files/sudoers
> 
>         _*output*_:
> 
>         usage: visudo [-chqsV] [-f sudoers]
> 
>         step 7:
> 
>         back in manifests/site.pp
> 
>         node 'mydomain.local.org <http://mydomain.local.org>' {
> 
>         include user
> 
>         include sudoers
> 
>         }
> 
>         step 8
> 
>         puppet$ sudo puppet agent --test
> 
>         does respond
> 
> 
>         I finally tried:
> 
>         node 'mydomain.local.org <http://mydomain.local.org>' {
> 
>           class { 'sudo': }
> 
>           sudo::conf { 'john.smith':
> 
>             priority => 10,
> 
>             source   => 'puppet:///files/etc/sudoers.d/users/john.smith',
> 
>            }
> 
>         }
> 
> 
>         still the agent doesn't respond
> 
>         can someone point me to the right direction please
> 

Hi Manyi,

Suggest checking out saz/sudo[1] instead of rolling your own.

[1] - https://github.com/saz/puppet-sudo

Best regards,
-g

-- 
Garrett Honeycutt
@learnpuppet
Puppet Training with LearnPuppet.com
Mobile: +1.206.414.8658

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/55199558.9060104%40garretthoneycutt.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to