[Mageia-sysadm] [263] - adapt the script to our infrastructure ( ie, use our domain, and create the directory holding the key )

root at mageia.org root at mageia.org
Wed Nov 17 15:28:30 CET 2010


Revision: 263
Author:   misc
Date:     2010-11-17 15:28:30 +0100 (Wed, 17 Nov 2010)
Log Message:
-----------
- adapt the script to our infrastructure ( ie, use our domain, and create the directory holding the key ) 

Modified Paths:
--------------
    puppet/modules/restrictshell/manifests/init.pp
    puppet/modules/restrictshell/templates/ldap-sshkey2file.py

Modified: puppet/modules/restrictshell/manifests/init.pp
===================================================================
--- puppet/modules/restrictshell/manifests/init.pp	2010-11-17 14:17:29 UTC (rev 262)
+++ puppet/modules/restrictshell/manifests/init.pp	2010-11-17 14:28:30 UTC (rev 263)
@@ -31,6 +31,14 @@
     ensure => installed,
   }
 
+  $pubkeys_directory = "/var/lib/pubkeys"
+  file { $pubkeys_directory:
+    ensure => directory,
+    owner => root,
+    group => root,
+    mode => 755,
+  }
+
   file { '/usr/local/bin/ldap-sshkey2file.py':
     ensure => present,
     owner => root,

Modified: puppet/modules/restrictshell/templates/ldap-sshkey2file.py
===================================================================
--- puppet/modules/restrictshell/templates/ldap-sshkey2file.py	2010-11-17 14:17:29 UTC (rev 262)
+++ puppet/modules/restrictshell/templates/ldap-sshkey2file.py	2010-11-17 14:28:30 UTC (rev 263)
@@ -9,10 +9,12 @@
 except ImportError, e:
     print "Please install python-ldap before running this program"
     sys.exit(1)
-
-basedn="dc=mandriva,dc=com"
+<%
+dc_suffix = 'dc=' + domain.gsub('.',',dc=')
+%>
+basedn="<%= dc_suffix %>"
 peopledn="ou=people,%s" % basedn
-uris=['ldap://kenobi.mandriva.com','ldap://svn.mandriva.com']
+uris=['ldap://ldap.<%= domain %>']
 random.shuffle(uris)
 uri = " ".join(uris)
 timeout=5
@@ -21,7 +23,7 @@
 # filter out disabled accounts also
 # too bad uidNumber doesn't support >= filters
 filter="(&(objectClass=inetOrgPerson)(objectClass=ldapPublicKey)(objectClass=posixAccount)(sshPublicKey=*)(!(shadowExpire=*)))"
-keypathprefix="/var/lib/config/pubkeys"
+keypathprefix="<%= pubkeys_directory %>"
 
 def usage():
     print "%s" % sys.argv[0]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/mageia-sysadm/attachments/20101117/dbbd1aef/attachment.html>


More information about the Mageia-sysadm mailing list