This is an extract from a defined type I use to create accounts:
<code extract>
define users::useraccount (
) {
     ......

            File {
               owner => $username,
               group => $username,
               mode  => '0600',
            }

            ......
          
            user { $username:
                ensure     => present,
                ....
            }

            group { $username:
                require => User[$username],
            }

            file { $userhome:
                ensure  => directory,
                require => [
                    User[$username],
                    Exec["mkdir-${username}"],
                ]
            }

            ## THE ADDITION OF THE FOLLOWING TWO RESOURCES MADE THE DIFFERENCE

            file { "${userhome}/.ssh":
                ensure  => directory,
                require => User[$username],
            }

            file { "${userhome}/.ssh/authorized_keys":
                ensure  => present,
                require => File["${userhome}/.ssh"],
            }   
<code extract>

Seems like Ruby was screaming about creating the target file when it does not 
exist.

Hope this helps someone out there.

“Sometimes I think the surest sign that intelligent life exists elsewhere in 
the universe is that none of it has tried to contact us.”
Bill Waterson (Calvin & Hobbes)

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to