/[adm]/puppet/modules/openssh/manifests/init.pp
ViewVC logotype

Diff of /puppet/modules/openssh/manifests/init.pp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2701 by misc, Mon Mar 19 18:03:48 2012 UTC revision 2702 by misc, Mon Apr 2 11:05:25 2012 UTC
# Line 1  Line 1 
1  class openssh {  class openssh { }
     # root account authorized_keys will be symlinked  
     # if you want to add symlink on other accounts, use $symlink_users parameter  
     class ssh_keys_from_ldap($symlink_users = [],  
                              $config = '') inherits server {  
   
         File ['/etc/ssh/sshd_config'] {  
             content => template('openssh/sshd_config','openssh/sshd_config_ldap')  
         }  
   
         package { 'python-ldap': }  
   
         $pubkeys_directory = '/var/lib/pubkeys'  
         file { $pubkeys_directory:  
             ensure => directory,  
         }  
   
         file { "$pubkeys_directory/root":  
             ensure => directory,  
             mode   => '0700',  
         }  
   
         file { "$pubkeys_directory/root/authorized_keys":  
             ensure => link,  
             target => "/root/.ssh/authorized_keys",  
             mode   => '0700',  
         }  
   
         symlink_user { $symlink_users: }  
   
         $ldap_pwfile = '/etc/ldap.secret'  
         $ldap_servers = get_ldap_servers()  
         local_script { 'ldap-sshkey2file.py':  
             content => template('openssh/ldap-sshkey2file.py'),  
             require => Package['python-ldap']  
         }  
   
         cron { 'sshkey2file':  
             command     => '/usr/local/bin/ldap-sshkey2file.py',  
             hour        => '*',  
             minute      => '*/10',  
             user        => 'root',  
             environment => 'MAILTO=root',  
             require     => Local_script['ldap-sshkey2file.py'],  
         }  
     }  
 }  

Legend:
Removed from v.2701  
changed lines
  Added in v.2702

  ViewVC Help
Powered by ViewVC 1.1.30