Issue #21148 has been updated by Stefan Schulte. Status changed from Accepted to Needs More Information Assignee set to Andrew Parker
can you please post the corresponding line in `/etc/passwd` for that user? When I execute the above code, the first useradd command creates the following line <pre> # uname -a SunOS testbox 5.10 Generic_147440-19 sun4u sparc SUNW,SPARC-Enterprise # getent passwd buggy buggy:x:44001:1::/home/buggy:/bin/sh </pre> So the home directory is reported correctly as `/home/buggy`. And I can also apply the manifest: <pre> debug: User[buggy](provider=user_role_add): Executing '/usr/sbin/useradd -s /bin/sh -u 44001 -g 1 -d /home/buggy buggy' debug: User[buggy](provider=user_role_add): Executing '/usr/bin/passwd -x -1 buggy' notice: /Stage[main]//User[buggy]/ensure: created </pre> I don't know why the useradd command complains on your machine. From my point of view it does not make any sense that `useradds` forbids to set home explicitly to `/home/XXX` and at the same time use it as a default if the homedirectory is not supplied. ---------------------------------------- Bug #21148: 'puppet resource user' does not report the correct home directory on Solaris https://projects.puppetlabs.com/issues/21148#change-92677 * Author: Andrew Parker * Status: Needs More Information * Priority: Normal * Assignee: Andrew Parker * Category: * Target version: * Affected Puppet version: * Keywords: * Branch: ---------------------------------------- The `home` that is reported is `/home/username`, however, this value cannot be used for managing the user or adding a user. This means that the output of `puppet resource user` cannot be fed into `puppet apply` to recreate, or enforce, that state. <pre> root@solaris-11-32-2:~# puppet resource user buggy ensure=present Notice: /User[buggy]/ensure: created user { 'buggy': ensure => 'present', } root@solaris-11-32-2:~# puppet resource user buggy > buggy.pp root@solaris-11-32-2:~# puppet resource user buggy ensure=absent Notice: /User[buggy]/ensure: removed user { 'buggy': ensure => 'absent', } root@solaris-11-32-2:~# cat buggy.pp user { 'buggy': ensure => 'present', gid => '10', home => '/home/buggy', password => 'UP', password_max_age => '-1', shell => '/usr/bin/bash', uid => '60008', } root@solaris-11-32-2:~# puppet apply buggy.pp Warning: Stringifying facts is deprecated, see the stringify_facts setting (at /usr/ruby/1.8/lib/ruby/site_ruby/1.8/puppet/indirector/facts/facter.rb:58:in `find') Error: Could not create user buggy: Execution of '/usr/sbin/useradd -u 60008 -s /usr/bin/bash -g 10 -d /home/buggy buggy' returned 3: UX: /usr/sbin/useradd: ERROR: Path must not start with '/home/'. UX: /usr/sbin/useradd: ERROR: /home/buggy is not a valid path name. Choose another. Error: /User[buggy]/ensure: change from absent to present failed: Could not create user buggy: Execution of '/usr/sbin/useradd -u 60008 -s /usr/bin/bash -g 10 -d /home/buggy buggy' returned 3: UX: /usr/sbin/useradd: ERROR: Path must not start with '/home/'. UX: /usr/sbin/useradd: ERROR: /home/buggy is not a valid path name. Choose another. Notice: Finished catalog run in 0.13 seconds root@solaris-11-32-2:~# </pre> -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" 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-bugs?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
