FAQ
Hi,

Thanks for responses. I added piece of code that will create home dir. Code
now looks like this:

     file { "/home/clavis":
         ensure => "directory",
         owner => "clavis",
         group => "clavis",
         mode => 700,
         require => [ User[clavis], Group[clavis] ],
     }

     user { "clavis":
         ensure => "present",
         home => "/home/clavis",
         name => "clavis",
         shell => "/bin/bash",
         managehome => true,
         groups => 'clavis',
         require => Group['clavis']
     }

When I try to execute it, I see this error on client:

err: Failed to apply catalog: Could not find dependency Group[clavis] for
User[clavis] at /etc/puppet/manifests/site.pp:25

If I understand it properly, it means it cannot create user because group
clavis do not exist. However, when I add line to add group:


     file { "/home/clavis":
         ensure => "directory",
         owner => "clavis",
         group => "clavis",
         mode => 700,
         require => [ User[clavis], Group[clavis] ],
     }

     group { 'clavis':
                 ensure => "present",
     }

     user { "clavis":
         ensure => "present",
         home => "/home/clavis",
         name => "clavis",
         shell => "/bin/bash",
         managehome => true,
         groups => 'clavis',
         require => Group['clavis']
     }

It tells me:

err: /Stage[main]//Node[puppetclient2]/User[clavis]/ensure: change from
absent to present failed: Could not create user clavis: Execution of
'/usr/sbin/useradd -d /home/clavis -s /bin/bash -G clavis -m clavis'
returned 9: useradd: group clavis exists - if you want to add this user to
that group, use -g.


So what is proper way to add user, create it's home dir, create it's group
and add it to group. Simply speaking, do the same what standard useradd
command would do ?

Thanks...


Best regards,
Dušan

On Tue, May 21, 2013 at 11:37 PM, Jeff Zellner wrote:

From the docs for `home`: "The home directory of the user. The
directory must be created separately and is not currently checked for
existence."

`managehome` doesn't ensure the creation of the home directory, I
believe it just checks permissions.

Cheers!

-Jeff
On Tue, May 21, 2013 at 6:22 PM, Denmat wrote:
Hi,

That should work. Can you provide a bit more info? Versions of puppet and
Ubuntu.

Can you also provide the output from your run with --debug?

Make sure the user is removed before you run again.

Cheers
Den

On 21/05/2013, at 22:39, dusan.dordevic@clavistechnology.com wrote:

Hi,

I am trying to create user on Ubuntu using this code:

user { "clavis":
ensure => "present",
home => "/home/clavis",
name => "clavis",
shell => "/bin/bash",
managehome => true,
groups => 'clavis',
require => Group['clavis']
}

User is created properly, but home directory is not created, although I
explicitly set mamagehome to true. Any idea what might be the problem here ?
Thanks in advance,
Dusan

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



--
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+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to a topic in the
Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/puppet-users/EkT8H779j4E/unsubscribe?hl=en
.
To unsubscribe from this group and all its topics, send an email to
puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 10 | next ›
Discussion Overview
grouppuppet-users @
categoriespuppet
postedMay 21, '13 at 12:39p
activeMay 22, '13 at 2:10p
posts10
users6
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase