Fixed manifest generation in user module for Puppet 2.6
This commit is contained in:
parent
bb0b107a07
commit
004854101a
2 changed files with 35 additions and 34 deletions
|
@ -59,7 +59,7 @@ conn.search(basedn, LDAP::LDAP_SCOPE_SUBTREE, 'objectClass=posixAccount',
|
||||||
# create user class
|
# create user class
|
||||||
if entry['uid'][0] !~ /.*\$.*/
|
if entry['uid'][0] !~ /.*\$.*/
|
||||||
print "class user::" + entry['uid'][0] + " inherits user::virtual {\n"
|
print "class user::" + entry['uid'][0] + " inherits user::virtual {\n"
|
||||||
print " realize(Newuser['" + entry['uid'][0] + "'])\n"
|
print " realize(User::Newuser['" + entry['uid'][0] + "'])\n"
|
||||||
groups.each do |group|
|
groups.each do |group|
|
||||||
print " realize(Group['" + group + "'])\n"
|
print " realize(Group['" + group + "'])\n"
|
||||||
end
|
end
|
||||||
|
|
|
@ -41,9 +41,8 @@ f.close
|
||||||
|
|
||||||
|
|
||||||
print <<EOF
|
print <<EOF
|
||||||
class user::virtual {
|
define user::newuser($uid, $gid, $comment, $home, $shell, $groups=undef, $requiregroups=undef) {
|
||||||
|
|
||||||
define newuser($uid, $gid, $comment, $home, $shell, $groups=undef, $requiregroups=undef) {
|
|
||||||
user { "${name}":
|
user { "${name}":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
uid => $uid,
|
uid => $uid,
|
||||||
|
@ -76,6 +75,8 @@ class user::virtual {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class user::virtual {
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,7 +97,7 @@ conn.search(basedn, LDAP::LDAP_SCOPE_SUBTREE, 'objectClass=posixAccount',
|
||||||
}
|
}
|
||||||
|
|
||||||
print "\n"
|
print "\n"
|
||||||
print " @newuser { '%s':\n" % entry['uid'][0]
|
print " @user::newuser { '%s':\n" % entry['uid'][0]
|
||||||
print " uid => '%s',\n" % entry['uidNumber'][0]
|
print " uid => '%s',\n" % entry['uidNumber'][0]
|
||||||
print " gid => '%s',\n" % entry['gidNumber'][0]
|
print " gid => '%s',\n" % entry['gidNumber'][0]
|
||||||
begin
|
begin
|
||||||
|
|
Loading…
Add table
Reference in a new issue